SEO页面静态化的方法

来源:互联网 发布:淘宝怎么对接淘客 编辑:程序博客网 时间:2024/04/29 22:59
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.IO;using System.Net;using System.Text;namespace NHibernateTest{    public partial class Login : System.Web.UI.Page    {        protected void Page_Load(object sender, EventArgs e)        {            WebClient wc = new WebClient();            wc.Encoding = Encoding.UTF8;            String filepath = "http://" + Request.Url.Host+"/"+HttpContext.Current.Request.ApplicationPath +"/default.aspx";            wc.DownloadFile(filepath, Server.MapPath("~/" + System.DateTime.Now.ToString("yyyyMMddhhmmss") + ".html"));        }    }}


default.aspx是需要静态化的页面,xxx.html是静态化后的页面.

 

原创粉丝点击