请问如何动态生成一个静态页面(a.html) 请问如何动态生成一个静态页面(a.html) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.cnblogs.com/kanshangren/articles/3959.html 请使用JavaScript的window.Open()方法,或者可以在代码中调用Response对象的write方法 a.html 的代码程序中输出就行了 /// <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("生成成功!"); } http://www.cnblogs.com/huobazi/archive/2007/12/31/UrlRewriteAndHttpHanderAndMakeStaticHtmlFiles.htmlhttp://www.devedu.com/Doc/DotNet/AspNet/Url地址重写-利用HttpHander手工编译页面并按需生成静态HTML文件.aspx [求助]Office 2007 组件的问题 ewebeditor编辑器的使用 treeview控件使用 想GridView被Update时执行一些我写的代码,是该写在GridView的Row_Updating里还是写在SqlDataSource的Row_Updating里? 文件路径问题(急用) 高手帮帮忙!~~! asp.net2.0 跨越提交的问题 Label中显示Session的值 简单的问题,有关框架的!在线等…… 私有字段加上属性实现其透明,那为什么不直接用public啊 如何将html页面中的纯文字提取出来并过滤所有的回车换行? 关于JS控制层的显示.刷新后仍然保持刷新前层的显示
/// <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("生成成功!");
}