Learning CSHARP by Example
Read a file line by line with no error checking
Useful if the file may be really large.
StreamReader sr = new StreamReader("fileName.txt"); string line; while((line= sr.ReadLine()) != null) { Console.WriteLine("xml template:"+line); } if (sr != null)sr.Close(); //should be in a "finally" or "using" block
+ نوشته شده در چهارشنبه چهارم اسفند ۱۳۸۹ ساعت 20:13 توسط علی احمدی
|