【静态页】关于静态页的问题,麻烦大家帮我解答一下,指点一二
1、生成了静态页之后,如果主页有登录,登录之后不是还要显示一个用户名,这个如何做
2、如果有分页,采取伪静态还是别的方法
protected void btn1_onclick(object sender,EventArgs e) { AddFilesByHtml("index.html", "http://192.168.1.11/index.aspx"); } /// <summary> /// 静态页 /// </summary> /// <param name="fileName">要保存的文件名</param> /// /// <param name="url">动态页路径url</param> /// <returns></returns> public static string AddFilesByHtml(string fileName, string url) { System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(url); System.Net.HttpWebResponse response = (System.Net.HttpWebResponse)request.GetResponse(); System.IO.StreamReader reader = new System.IO.StreamReader(response.GetResponseStream(), Encoding.GetEncoding("utf-8")); string innerHtml = reader.ReadToEnd(); if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(fileName))) { System.IO.File.Delete(System.Web.HttpContext.Current.Server.MapPath(fileName)); } System.Threading.Thread.Sleep(100); StreamWriter SW = new StreamWriter(System.Web.HttpContext.Current.Server.MapPath(fileName), false, Encoding.GetEncoding("utf-8")); SW.WriteLine(innerHtml); SW.Close(); return fileName; }