using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
using (StreamReader sr=new StreamReader(@"E:\文件\C#\实验6\实验6代码.txt",Encoding.Default))//读取
{
while (!sr.EndOfStream)
{
Console.WriteLine(sr.ReadLine());
}
}
using (FileStream fs = new FileStream(@"C:\Users\Administrator\Desktop\1.txt", FileMode.Append))
using (StreamWriter sw = new StreamWriter(fs))//写入
{
sw.WriteLine("Hello,this is a StreamWriter test!");
}
}
}
}