[C#] How to Get all drives in C#
Hello friends ! Today I will show you how to use GetLogicalDrives method of returns all logical drives on a system. To do this, create a new Project and write…
Từ căn bản tới nâng cao
Hello friends ! Today I will show you how to use GetLogicalDrives method of returns all logical drives on a system. To do this, create a new Project and write…
Hello friends ! Now, we will learn How to Get Root Directory in C #. The GetRootDirectory method returns the root directory of the specified directory. The code below, we…
Hello friends ! Now, we will learn How to Get Files in a Directory in C#. The GetFiles method gets a list of files in the specified directory. To get…
Hello friends ! Now, we will learn How to Get Sub Directories in C# ?. The GetDirectories method of the Directory class loads all the subdirectories of a directory. To…
Hello friends ! Now, we will learn How to Get and Set Current Directory in C#. The SetCurrentDirectory method sets the specified directory as the current directory. The GetCurrentDirectory method…
The SetLastWriteTime and GetLastWriteTime methods are used to set and get the last write date and time of the specified directory. The following code snippet sets and gets the last…
The SetLastAccessTime and GetLastAccessTime methods are used to set and get the last access date and time of the specified directory. The following code snippet sets and gets the last…
The Directory.SetCreationTime and Directory.GetCreationTime methods are used to set and get the creation date and time of the specified directory. The following code snippet sets and gets the creation time…
The Directory.EnumerateFiles method returns an enumerable collection of file names in the specified directory. string root = @"C:\\Temp"; // Get a list of all subdirectories var files = from file…
The Directory.EnumerateDirectories method returns an enumerable collection of directory names in the specified directory. string root = @"C:\\Temp"; // Get a list of all subdirectories var dirs = from dir…
There is no method to copy a directory. The copying a directory is a process of creating a new directory that you to want a directory to move to and…
The Directory.Move method moves an existing directory to a new specified directory with full path. The Move method takes two parameters. The Move method deletes the original directory. The following…
The following code snippet checks if a directory has subdirectories and files and delete them before deleting a directory. Check if a directory Exists The Directory.Exists method checks if the…
The Directory.Delete method deletes an empty directory from the specified path permanently. If a directory has subdirectories and/or files, you must delete them before you can delete a directory. If…