读取txt文件

if (!File.Exists(MapPath('070613.txt'))) 
   {
    Response.Write("文件"+MapPath("070613.txt")+"打开出错");
    return;
   }
   StreamReader txtread = new StreamReader(MapPath('weather.txt'), System.Text.Encoding.Default);
   String txt = txtread.ReadToEnd();
   txtread.Close();

再对txt进行分析
不过重复读取txt有点慢
posted on 2008-04-01 16:54  heart-in-sky  阅读(310)  评论(0)    收藏  举报