FileStream Class

Overview

  • Provides a file specific implementation of a Stream.

Good practice

  • Remember to call Close on a stream.

Examples

Read a File

// FileStream is simply a stream around a file, overriding Stream methods
FileStream a = new FileStream(@"C:\Public\Test.txt", FileMode.Open);
 
while (a.Position != a.Length)
{
    Console.Write((char)a.ReadByte());
}
 
learning/exam70-536/filestream.txt · Last modified: 2008/08/27 14:34 by david
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki