Table of Contents

Namespace System.IO

Classes

Directory

Exposes static methods for creating, moving, and enumerating through directories and subdirectories. This class cannot be inherited.

DirectoryInfo

Exposes instance methods for creating, moving, and enumerating through directories and subdirectories. This class cannot be inherited.

DriveInfo

Provides access to information on a drive.

File

Provides static methods for the creation, copying, deletion, moving, and opening of a single file, and aids in the creation of FileStream objects.

FileInfo

Provides properties and instance methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects. This class cannot be inherited.

FileStream

Provides a Stream for a file, supporting both synchronous and asynchronous read and write operations.

FileSystemInfo

Provides the base class for both FileInfo and DirectoryInfo objects.

IOException

The exception that is thrown when an I/O error occurs.

MemoryStream

Creates a stream whose backing store is memory.

Path

Provides methods for processing file system strings in a cross-platform manner. Most of the methods don't do a complete parsing (such as examining a UNC hostname), but they will handle most string operations.

Stream

Provides a generic view of a sequence of bytes. This is an abstract class.

StreamReader

Implements a TextReader that reads characters from a byte stream in a particular encoding.

StreamWriter

Implements a TextWriter for writing characters to a stream in a particular encoding.

TextReader

Represents a reader that can read a sequential series of characters.

TextWriter

Represents a writer that can write a sequential series of characters. This class is abstract.

Enums

DriveType

Defines constants for drive types, including CDRom, Fixed, Network, NoRootDirectory, Ram, Removable, and Unknown.

FileAccess

Contains constants for specifying the access you want for a file. You can have Read, Write or ReadWrite access.

FileAttributes

Provides attributes for files and directories.

FileMode

Contains constants for specifying how the OS should open a file. These will control whether you overwrite a file, open an existing file, or some combination thereof.

To append to a file, use Append (which maps to OpenOrCreate then we seek to the end of the file). To truncate a file or create it if it doesn't exist, use Create.

FileShare

Contains constants for controlling file sharing options while opening files. You can specify what access other processes trying to open the same file concurrently can have.

IOException.IOExceptionErrorCode

Provides values for error codes.

SeekOrigin

Specifies the position in a stream to use for seeking.