请问如何动态生成一个静态页面(a.html)

解决方案 »

  1.   

    http://www.cnblogs.com/kanshangren/articles/3959.html
      

  2.   

    请使用JavaScript的window.Open()方法,或者可以在代码中调用Response对象的write方法
      

  3.   

    a.html 的代码程序中输出就行了
      

  4.   


    /// <summary>
            /// 传入URL返回网页的html代码
            /// </summary>
            /// <param name="Url">URL</param>
            /// <returns></returns>
            public static string getUrltoHtml(string Url)
            {
                string errorMsg = string.Empty;
                try
                {
                    System.Net.WebRequest wReq = System.Net.WebRequest.Create(Url);
                    System.Net.WebResponse wResp = wReq.GetResponse();
                    System.IO.Stream respStream = wResp.GetResponseStream();
                    System.IO.StreamReader reader = new System.IO.StreamReader(respStream,System.Text.Encoding.GetEncoding("gb2312"));
                    string sResultContents = reader.ReadToEnd(); 
                    return sResultContents;
                }
                catch (System.Exception ex)
                {
                    errorMsg = ex.Message;
                }
                return null;
            }
    void makeIndex()
        {
            string Path = Server.MapPath(@"../../Web");
            string file = Path + "\\Default.html";
            string Url = "/Web/Default.aspx";
            makeHtml(file, Url);
            JsAlert("生成成功!");
        }
      

  5.   

    http://www.cnblogs.com/huobazi/archive/2007/12/31/UrlRewriteAndHttpHanderAndMakeStaticHtmlFiles.htmlhttp://www.devedu.com/Doc/DotNet/AspNet/Url地址重写-利用HttpHander手工编译页面并按需生成静态HTML文件.aspx