FileInfo f = new FileInfo("D://Test.doc");
StreamWriter w = f.CreateText();
w.WriteLine("this is a text!");
w.Close();
Console.WriteLine("sdfsdfsdf:");
StreamReader s = File.OpenText("D://Test.txt");
string read = null;
while ((read = s.ReadLine()) != null)
{
Console.WriteLine(read);
}
s.Close();
对文件进行创建、写入、读取
最新推荐文章于 2022-05-04 12:35:43 发布