using System.Text;
using System.IO;

 

    string path = "UploadFiles/mm.txt";
            StringBuilder str = new StringBuilder();
            string line;
            //using (StreamReader sr = File.OpenText(Server.MapPath(path)))
            using(StreamReader sr = new StreamReader(Server.MapPath(path),System.Text.Encoding.Default))
            { 
                 while ((line = sr.ReadLine()) != null)
                {
                    str.Append(line);
                    str.Append("<br>");//产生换行效果
                }
            }
            Response.Write(str.ToString());

posted on 2009-12-31 16:00  cean  阅读(446)  评论(0编辑  收藏  举报