标签:
using System;
using System.IO;
class FileTest
{
public static void Main()
{
StreamReader srd;
string path = @"c:\temp\MyTest.txt";
try
{
srd = File.OpenText (path);
}
catch
{
Console.WriteLine("File open failed");
return;
}
while (srd.Peek() != -1)
{
String str = srd.ReadLine();
Console.WriteLine(str);
Console.ReadKey();
}
}
}
标签:
原文地址:http://www.cnblogs.com/xblydy/p/4300944.html