Skip to content

File IO

Mario Gutierrez edited this page Jan 7, 2017 · 4 revisions

System.IO contains many classes for file I/O.

  • BinaryReader/BinaryWriter - store and retrieve primitive data types as a binary value.
  • BufferedStream - provides temporary storage for a stream of bytes that you can later commit to disk.
  • Directory/DirectoryInfo - manipulate a machine's directory structure. Directory exposes functionality with static members, while the DirectoryInfo type exposes similar functionality from a valid object reference.
  • DriveInfo - detailed information about system drives.
  • File/FileInfo - manipulate a machine's files. File exposes functionality with static members, while the FileInfo type exposes similar functionality from a valid object reference.
  • FileStream - random access to a file, with data represented as a stream of bytes.
  • FileSystemWatcher - monitor modification of files in a specified directory.
  • MemoryStream - random access to data stored in memory rather than in a physical file.
  • Path - performs operations on string types that contain file path information in a platform independent manner.
  • StreamWriter/StreamReader - store and retrieve textual information to and from a file. Does not support random access.
  • StringWriter/StringReader - like StreamWriter/StreamReader, but with an underlying buffer rather than physical file.
Clone this wiki locally