1. 首页
  2. 编程语言
  3. C#
  4. public static bool WriteFile(string strText.pdf

public static bool WriteFile(string strText.pdf

上传者: 2021-05-12 13:29:14上传 PDF文件 74.72KB 热度 8次
public static bool WriteFile(string strText,string strContent,string strAuthor) { string path = HttpContext.Current.Server.MapPath("/news/"); Encoding code = Encoding.GetEncoding("gb2312"); string temp = HttpContext.Current.Server.MapPath("/news/template.html"); StreamReader sr=null; StreamWriter sw=null; string str=""; try { sr = new StreamReader(temp, code); str = sr.ReadToEnd(); } catch(Exception exp) { HttpContext.Current.Response.Write(exp.Message); HttpContext.Current.Response.End(); sr.Close(); } -----------------------
下载地址
用户评论