FileSystem Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides properties and methods for working with drives, files, and directories.
public ref class FileSystem
public class FileSystem
type FileSystem = class
Public Class FileSystem
- Inheritance
-
FileSystem
This example checks to determine whether the folder C:\backup\logs
exists and checks its properties.
Dim logInfo As System.IO.DirectoryInfo
If My.Computer.FileSystem.DirectoryExists("C:\backup\logs") Then
logInfo = My.Computer.FileSystem.GetDirectoryInfo(
"C:\backup\logs")
End If
The following table lists examples of tasks involving the My.Computer.FileSystem
object.
File |
Initializes a new instance of the FileSystem class. |
Current |
Gets or sets the current directory. |
Drives |
Returns a read-only collection of all available drive names. |
Combine |
Combines two paths and returns a properly formatted path. |
Copy |
Copies the contents of a directory to another directory. |
Copy |
Copies the contents of a directory to another directory. |
Copy |
Copies the contents of a directory to another directory. |
Copy |
Copies the contents of a directory to another directory. |
Copy |
Copies a file to a new location. |
Copy |
Copies a file to a new location. |
Copy |
Copies a file to a new location. |
Copy |
Copies a file to a new location. |
Create |
Creates a directory. |
Delete |
Deletes a directory. |
Delete |
Deletes a directory. |
Delete |
Deletes a directory. |
Delete |
Deletes a file. |
Delete |
Deletes a file. |
Delete |
Deletes a file. |
Directory |
Returns |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
File |
Returns |
Find |
Returns a read-only collection of strings representing the names of files containing the specified text. |
Find |
Returns a read-only collection of strings representing the names of files containing the specified text. |
Get |
Returns a collection of strings representing the path names of subdirectories within a directory. |
Get |
Returns a collection of strings representing the path names of subdirectories within a directory. |
Get |
Returns a DirectoryInfo object for the specified path. |
Get |
Returns a DriveInfo object for the specified drive. |
Get |
Returns a FileInfo object for the specified file. |
Get |
Returns a read-only collection of strings representing the names of files within a directory. |
Get |
Returns a read-only collection of strings representing the names of files within a directory. |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Parses the file name out of the path provided. |
Get |
Returns the parent path of the provided path. |
Get |
Creates a uniquely named zero-byte temporary file on disk and returns the full path of that file. |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
Move |
Moves a directory from one location to another. |
Move |
Moves a directory from one location to another. |
Move |
Moves a directory from one location to another. |
Move |
Moves a directory from one location to another. |
Move |
Moves a file to a new location. |
Move |
Moves a file to a new location. |
Move |
Moves a file to a new location. |
Move |
Moves a file to a new location. |
Open |
The |
Open |
The |
Open |
The |
Open |
Opens a StreamReader object to read from a file. |
Open |
Opens a StreamReader object to read from a file. |
Open |
Opens a StreamWriter to write to the specified file. |
Open |
Opens a StreamWriter object to write to the specified file. |
Read |
Returns the contents of a file as a byte array. |
Read |
Returns the contents of a text file as a |
Read |
Returns the contents of a text file as a |
Rename |
Renames a directory. |
Rename |
Renames a file. |
To |
Returns a string that represents the current object. (Inherited from Object) |
Write |
Writes data to a binary file. |
Write |
Writes text to a file. |
Write |
Writes text to a file. |
Product | Versions |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: