1 //StreamRead來讀取一個文件 2 using (StreamReader sr = new StreamReader(@"C:\Users\wbrm\Desktop\新建文本文檔.txt", Encoding.Default)) 3 { 4 while (!sr.EndOfStream... ...
1 //StreamRead來讀取一個文件 2 using (StreamReader sr = new StreamReader(@"C:\Users\wbrm\Desktop\新建文本文檔.txt", Encoding.Default)) 3 { 4 while (!sr.EndOfStream)//迴圈的度 5 { 6 Console.WriteLine(sr.ReadLine()); 7 } 8 } 9 Console.ReadKey();
1 //StreamRead來讀取一個文件 2 using (StreamReader sr = new StreamReader(@"C:\Users\wbrm\Desktop\新建文本文檔.txt", Encoding.Default)) 3 { 4 while (!sr.EndOfStream)//迴圈的度 5 { 6 Console.WriteLine(sr.ReadLine()); 7 } 8 } 9 Console.ReadKey();