FileSystem Class
Provides properties and methods for working with drives, files, and directories.
Namespace: Microsoft.VisualBasic.FileIO
Assembly: Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
The FileSystem type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | CurrentDirectory | Gets or sets the current directory. |
![]() ![]() | Drives | Returns a read-only collection of all available drive names. |
| Name | Description | |
|---|---|---|
![]() ![]() | CombinePath | Combines two paths and returns a properly formatted path. |
![]() ![]() | CopyDirectory(String, String) | Copies the contents of a directory to another directory. |
![]() ![]() | CopyDirectory(String, String, UIOption) | Copies the contents of a directory to another directory. |
![]() ![]() | CopyDirectory(String, String, Boolean) | Copies the contents of a directory to another directory. |
![]() ![]() | CopyDirectory(String, String, UIOption, UICancelOption) | Copies the contents of a directory to another directory. |
![]() ![]() | CopyFile(String, String) | Copies a file to a new location. |
![]() ![]() | CopyFile(String, String, UIOption) | Copies a file to a new location. |
![]() ![]() | CopyFile(String, String, Boolean) | Copies a file to a new location. |
![]() ![]() | CopyFile(String, String, UIOption, UICancelOption) | Copies a file to a new location. |
![]() ![]() | CreateDirectory | Creates a directory. |
![]() ![]() | DeleteDirectory(String, DeleteDirectoryOption) | Deletes a directory. |
![]() ![]() | DeleteDirectory(String, UIOption, RecycleOption) | Deletes a directory. |
![]() ![]() | DeleteDirectory(String, UIOption, RecycleOption, UICancelOption) | Deletes a directory. |
![]() ![]() | DeleteFile(String) | Deletes a file. |
![]() ![]() | DeleteFile(String, UIOption, RecycleOption) | Deletes a file. |
![]() ![]() | DeleteFile(String, UIOption, RecycleOption, UICancelOption) | Deletes a file. |
![]() ![]() | DirectoryExists | Returns True if the specified directory exists. |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() ![]() | FileExists | Returns True if the specified file exists. |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() ![]() | FindInFiles(String, String, Boolean, SearchOption) | Returns a read-only collection of strings representing the names of files containing the specified text. |
![]() ![]() | FindInFiles(String, String, Boolean, SearchOption, String[]) | Returns a read-only collection of strings representing the names of files containing the specified text. |
![]() ![]() | GetDirectories(String) | Returns a collection of strings representing the path names of subdirectories within a directory. |
![]() ![]() | GetDirectories(String, SearchOption, String[]) | Returns a collection of strings representing the path names of subdirectories within a directory. |
![]() ![]() | GetDirectoryInfo | Returns a DirectoryInfo object for the specified path. |
![]() ![]() | GetDriveInfo | Returns a DriveInfo object for the specified drive. |
![]() ![]() | GetFileInfo | Returns a FileInfo object for the specified file. |
![]() ![]() | GetFiles(String) | Returns a read-only collection of strings representing the names of files within a directory. |
![]() ![]() | GetFiles(String, SearchOption, String[]) | Returns a read-only collection of strings representing the names of files within a directory. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() ![]() | GetName | Parses the file name out of the path provided. |
![]() ![]() | GetParentPath | Returns the parent path of the provided path. |
![]() ![]() | GetTempFileName | Creates a uniquely named zero-byte temporary file on disk and returns the full path of that file. |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() ![]() | MoveDirectory(String, String) | Moves a directory from one location to another. |
![]() ![]() | MoveDirectory(String, String, UIOption) | Moves a directory from one location to another. |
![]() ![]() | MoveDirectory(String, String, Boolean) | Moves a directory from one location to another. |
![]() ![]() | MoveDirectory(String, String, UIOption, UICancelOption) | Moves a directory from one location to another. |
![]() ![]() | MoveFile(String, String) | Moves a file to a new location. |
![]() ![]() | MoveFile(String, String, UIOption) | Moves a file to a new location. |
![]() ![]() | MoveFile(String, String, Boolean) | Moves a file to a new location. |
![]() ![]() | MoveFile(String, String, UIOption, UICancelOption) | Moves a file to a new location. |
![]() ![]() | OpenTextFieldParser(String) | The OpenTextFieldParser method allows you to create a TextFieldParser object, which provides a way to easily and efficiently parse structured text files, such as logs. The TextFieldParser object can be used to read both delimited and fixed-width files. |
![]() ![]() | OpenTextFieldParser(String, Int32[]) | The OpenTextFieldParser method allows you to create a TextFieldParser object, which provides a way to easily and efficiently parse structured text files, such as logs. The TextFieldParser object can be used to read both delimited and fixed-width files. |
![]() ![]() | OpenTextFieldParser(String, String[]) | The OpenTextFieldParser method allows you to create a TextFieldParser object, which provides a way to easily and efficiently parse structured text files, such as logs. The TextFieldParser object can be used to read both delimited and fixed-width files. |
![]() ![]() | OpenTextFileReader(String) | Opens a StreamReader object to read from a file. |
![]() ![]() | OpenTextFileReader(String, Encoding) | Opens a StreamReader object to read from a file. |
![]() ![]() | OpenTextFileWriter(String, Boolean) | Opens a StreamWriter object to write to the specified file. |
![]() ![]() | OpenTextFileWriter(String, Boolean, Encoding) | Opens a StreamWriter to write to the specified file. |
![]() ![]() | ReadAllBytes | Returns the contents of a file as a byte array. |
![]() ![]() | ReadAllText(String) | Returns the contents of a text file as a String. |
![]() ![]() | ReadAllText(String, Encoding) | Returns the contents of a text file as a String. |
![]() ![]() | RenameDirectory | Renames a directory. |
![]() ![]() | RenameFile | Renames a file. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() ![]() | WriteAllBytes | Writes data to a binary file. |
![]() ![]() | WriteAllText(String, String, Boolean) | Writes text to a file. |
![]() ![]() | WriteAllText(String, String, Boolean, Encoding) | Writes text to a file. |
The following table lists examples of tasks involving the My.Computer.FileSystem object.
Note |
|---|
The HostProtectionAttribute attribute applied to this type or member has the following Resources property value: Resources. The HostProtectionAttribute does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the HostProtectionAttribute class or SQL Server Programming and Host Protection Attributes. |
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.




Note