Objective-C,iPhone,C#

Objective-C,iPhone,C#

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
先生成html到服务器硬盘上,然后根据WebClient这个类去download那个html文件,下面那个Replace不是替换成html,这边是设置后缀,不是很了解的可以参照微软的msdn看一下webclient类。
这是真正的静态页
原理很简单
 1     public class SetRemoteURL
 2     {
 3         static string str2HTML = string.Empty;
 4         public SetRemoteURL() { }
 5         /// <summary>
 6         /// to THML
 7         /// </summary>
 8         /// <param name="strWebFromName">要转换的aspx文件,带后缀</param>
 9         public static void Convert(string strWebFormName)
10         {
11             str2HTML = str2HTML.ToLower();
12             str2HTML = strWebFormName.Replace(".aspx"".html");
13 
14             string strURL = "http://" + HttpContext.Current.Request.Url.Authority + "/" + strWebFormName;
15             new System.Net.WebClient().DownloadFile(strURL, System.Web.HttpContext.Current.Server.MapPath("~/" + str2HTML));
16             HttpContext.Current.Response.Redirect(str2HTML);
17         }
18     }
posted on 2009-07-27 16:52  墨墨  阅读(566)  评论(1编辑  收藏  举报