asp.net 读取txt文件
StreamReader sr = new StreamReader(MapPath("weather.txt"), System.Text.Encoding.Default);String input = sr.ReadToEnd();sr.Close();
string path = "D:\\56huiWord\\test.txt";StreamWriter sw = File.CreateText("D:\\56huiWord\\temp.txt");sw.WriteLine("aaaaaaaaaa");sw.WriteLine("bbb");sw.Flush();sw.Close();
File.Delete(fileName);File.Copy("D:\\56huiWord\\temp.txt", fileName);File.Delete("D:\\56huiWord\\temp.txt");