C#streamreader和streamwriter如何一起用?
FileStream aFile = new FileStream("test.txt", FileMode.Open);StreamWriter SW = new StreamWriter(aFile);
SW.WriteLine("It is a test file!");
SW.Close();
StreamReader SR = new StreamReader(aFile);
string Data = SR.ReadToEnd();
SR.Close();
上面代码运行时回报错,哪个大侠帮忙指导下。StreamReader和StreamWriter如何一起用?