扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
一个是一个页面转换的类,该类通过静态函数Changfile()来实现,动态页面到静态页面的转换。
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Text; using System.IO; /**//// /// Summary description for HtmlProxy /// public class HtmlProxy ...{ public HtmlProxy() ...{ } public static bool ChangeFile(int id) ...{ string filename = HttpContext.Current.Server.MapPath("Post_" + id + ".html"); |
Stream st = GetFileStream(filename); //如果文件存在并且读取成功 if (st != null) ...{ using (st) ...{ StreamToStream(st, HttpContext.Current.Response.OutputStream); return true; //Response.End(); } } else ...{ StringWriter sw = new StringWriter(); HttpContext.Current.Server.Execute("ForumDetail.aspx?PID=" + id, sw); string content = sw.ToString(); |
濠碘€冲€归悘澶愬箖閵娾晜濮滈悽顖涚摃閹烩晠宕氶崶鈺傜暠闁诡垰鍘栫花锛勬喆椤ゅ弧濡澘妫楅悡娆撳嫉閳ь剟寮0渚€鐛撻柛婵呮缁楀矂骞庨埀顒勫嫉椤栨瑤绻嗛柟顓у灲缁辨繈鏌囬敐鍕杽閻犱降鍨藉Σ鍕嚊閹跺鈧﹦绱旈幋鐐参楅柡鍫灦閸嬫牗绂掔捄铏规闁哄嫷鍨遍崑宥夋儍閸曨剚浠樺ù锝嗗▕閳ь剚鏌ㄧ欢鐐寸▕鐎b晝顏遍柕鍡嫹
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者