把当前aspx保存成html

     protected   override   void  Render(HtmlTextWriter writer)
    {
        System.IO.StringWriter html 
=   new  System.IO.StringWriter();
        System.Web.UI.HtmlTextWriter tw 
=   new  HtmlTextWriter(html);
        
base .Render(tw);
        System.IO.StreamWriter sw 
=   new  System.IO.StreamWriter(Server.MapPath( " index.html " ),  false , System.Text.Encoding.UTF8);
        sw.Write(html.ToString());
        sw.Close();
        tw.Close();
        Response.Redirect(
" index.html " );
    }


你可能感兴趣的:(html)