Export (0) Print
Expand All

File Access Through the FileStream Class

Visual Studio .NET 2003

The FileStream class provides access to files, including the standard input, output, and error devices. You use it with the File class, which aids in creating FileStream objects and provides routines for creating, copying, deleting, moving, and opening files. Another class, Path, provides a means of manipulating strings that represent folder or file paths.

The FileAccess, FileMode, and FileShare enumerations contain the flags used by the constructors of the FileStream class, and affect how the underlying file is created, opened, and shared. The FileEnumerator enumeration provides a means of reading the information maintained by the host file system for a specified group of files and directories. The FileEnumerator enumeration allows read access to information such as access and creation dates.

When used in conjunction with FileEnumerator, the FileAttributes enumeration enables the gathering of file-specific information. The FileAttributes enumeration returns the file's stored attributes, such as whether it is an archive, compressed, a directory, encrypted, hidden, read-only, a system file, or a temporary file.

See Also

File Access with Visual Basic .NET | File Access Through BinaryReader and BinaryWriter Classes | File Access Through StreamReader and StreamWriter Classes | Drive and Folder Access | System.IO Namespace | Code: Reading from a Text File (Visual Basic) | Code: Writing Text to a File (Visual Basic)

© 2015 Microsoft