Classes Used in .NET Framework File I/O and the File System (Visual Basic)
The following tables list the classes commonly used for .NET Framework file I/O, categorized into file I/O classes, classes used for creating streams, and classes used to read and write to streams.
To enter the .NET Framework 2.0 documentation and find a more comprehensive listing, see .NET Framework Class Library Overview.
Basic I/O Classes for Files, Drives, and Directories
The following table lists and describes the main classes used for file I/O.
Class |
Description |
---|---|
Provides static methods for creating, moving, and enumerating through directories and subdirectories. |
|
Provides instance methods for creating, moving, and enumerating through directories and subdirectories. |
|
Provides instance methods for creating, moving, and enumerating through drives. |
|
Provides static methods for creating, copying, deleting, moving, and opening files, and aids in the creation of a FileStream. |
|
Defines constants for read, write, or read/write access to a file. |
|
Provides attributes for files and directories such as Archive, Hidden, and ReadOnly. |
|
Provides static methods for creating, copying, deleting, moving, and opening files, and aids in the creation of a FileStream. |
|
Controls how a file is opened. This parameter is specified in many of the constructors for FileStream and IsolatedStorageFileStream, and for the Open methods of File and FileInfo. |
|
Defines constants for controlling the type of access other file streams can have to the same file. |
|
Provides methods and properties for processing directory strings. |
|
Controls the access of files and folders by defining Read, Write, Append and PathDiscovery permissions. |
Classes Used to Create Streams
The following table lists and describes the main classes used to create streams.
Class |
Description |
---|---|
Adds a buffering layer to read and write operations on another stream. |
|
Supports random access to files through its Seek method. FileStream opens files synchronously by default but also supports asynchronous operation. |
|
Creates a stream whose backing store is memory, rather than a file. |
|
Provides the underlying stream of data for network access. |
|
Defines a stream that links data streams to cryptographic transformations. |
Classes Used to Read from and Write to Streams
The following table shows the specific classes used for reading from and writing to files with streams.
Class |
Description |
---|---|
Reads encoded strings and primitive data types from a FileStream. |
|
Writes encoded strings and primitive data types to a FileStream. |
|
Reads characters from a FileStream, using CurrentEncoding to convert characters to and from bytes. StreamReader has a constructor that attempts to ascertain the correct CurrentEncoding for a given stream, based on the presence of a CurrentEncoding-specific preamble, such as a byte order mark. |
|
Writes characters to a FileStream, using Encoding to convert characters to bytes. |
|
Reads characters from a String. Output can be either a stream in any encoding or a String. |
|
Writes characters to a String. Output can be either a stream in any encoding or a String. |
See Also
Concepts
Basics of .NET Framework File I/O and the File System (Visual Basic)