using System.IO;StreamReader sr = new StreamReader(Server.MapPath("yourtxt.txt"), System.Text.Encoding.GetEncoding("GB2312"));
string s = sr.ReadToEnd();
sr.Close();

解决方案 »

  1.   

    这是我读报表模板用到的
                    objFS = System.Web.HttpContext.Current.Server.CreateObject("scripting.filesystemobject")
                    objFile = objFS.opentextfile(strTempletPath, 1, False, 0)
                    Do While objFile.atendofstream <> True
                        strtemp = objFile.readline
                        strFileText = strFileText & strtemp
                    Loop
                    objFile.Close()
                    objFile = Nothing
                    objFS = Nothing