protected void Page_Load()
{
Response.Charset = "";
this.EnableViewState = false;
StringWriter tw = new StringWriter();
HtmlTextWriter wt = new HtmlTextWriter(tw);
string path = @"C:\Inetpub\wwwroot\etcms\WebSite\test.html";
//FileInfo info =new FileInfo(@"c:\test.txt");
StreamWriter wter = File.CreateText(path);
//输出所有信息
this.RenderControl(wt);
wter.Write(tw.ToString());
//Response.Write(tw.ToString());
wter.Close();
wt.Close();
tw.Close();
Response.End();
//生成相应文件,然后定向到该文件
Response.Redirect(path);
}
{
Response.Charset = "";
this.EnableViewState = false;
StringWriter tw = new StringWriter();
HtmlTextWriter wt = new HtmlTextWriter(tw);
string path = @"C:\Inetpub\wwwroot\etcms\WebSite\test.html";
//FileInfo info =new FileInfo(@"c:\test.txt");
StreamWriter wter = File.CreateText(path);
//输出所有信息
this.RenderControl(wt);
wter.Write(tw.ToString());
//Response.Write(tw.ToString());
wter.Close();
wt.Close();
tw.Close();
Response.End();
//生成相应文件,然后定向到该文件
Response.Redirect(path);
}