using System;
using System.IO;
namespace FileIOApplication
{
class Program
{
static void Main(string[] args)
{
string s = @"我是汪伟
你是谁呀?
阿里的身份就离开了。";
using (StreamWriter sw = new StreamWriter("a.txt"))
{
sw.WriteLine(s);
}
string r = "";
using (StreamReader sr = new StreamReader("a.txt"))
{
while ((r = sr.ReadLine()) != null)
{
Console.WriteLine(r);
}
}
Console.ReadKey();
}
}
}
c#读写文件(覆盖、行读)
最新推荐文章于 2023-11-04 14:08:11 发布