asp.net 读取txt文件

StreamReader sr = new StreamReader(MapPath("weather.txt"), System.Text.Encoding.Default);
String input = sr.ReadToEnd();
sr.Close();

asp.net修改txt文件2008-01-25 18:34

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");

相关文章:

  • 2022-02-12
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-03
  • 2022-01-23
  • 2021-10-04
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2022-02-08
相关资源
相似解决方案