自动生成一个.html文件

protected override void Render(HtmlTextWriter writer)
  {
StringWriter sw = new StringWriter();
HtmlTextWriter htmlwriter = new HtmlTextWriter(sw);

base.Render (htmlwriter);
string result = sw.ToString();
StreamWriter writerstring = File.CreateText(@"C:\somehtml.html");
writerstring.Write(result);
writerstring.Close();

//write it out to the browser
writer.Write(result);

}

你可能感兴趣的:(html)