Wikis > C# Wiki > StreamReader

string _FileText;
using (System.IO.StreamReader _StreamReader = new System.IO.StreamReader("PathFile"))
{ _FileText = _StreamReader.ReadToEnd(); }

string _TextLine;
using (System.IO.StreamReader _StreamReader = new System.IO.StreamReader("PathFile"))
{ 
   while ((_TextLine = _StreamReader.ReadLine()) != null) 
   { Console.WriteLine(_TextLine); }
}

MSDN Artikel

Category: Tags: