public string temp = HttpContext.Current.Server.MapPath(“write.htm“); public Encoding code = Encoding.GetEncoding(“gb2312“); public StreamReader sr=null; public string str=““;
public StreamWriter sw=null; public string htmlfilename=DateTime.Now.ToString(“yyyyMMddHHmmss“)+“.html“;//文件名 private void Page_Load(object sender, System.EventArgs e) { try { sr = new StreamReader(temp, code); str = sr.ReadToEnd(); // 读取文件 } catch(Exception exp) { HttpContext.Current.Response.Write(exp.Message); HttpContext.Current.Response.End();
public string temp = HttpContext.Current.Server.MapPath(“write.htm“); public Encoding code = Encoding.GetEncoding(“gb2312“); public StreamReader sr=null; public string str=““;
public StreamWriter sw=null; public string htmlfilename=DateTime.Now.ToString(“yyyyMMddHHmmss“)+“.html“;//文件名 private void Page_Load(object sender, System.EventArgs e) { try { sr = new StreamReader(temp, code); str = sr.ReadToEnd(); // 读取文件 } catch(Exception exp) { HttpContext.Current.Response.Write(exp.Message); HttpContext.Current.Response.End();