private void Button1_Click(object sender, System.EventArgs e)
{
string PageUrl = http://localhost/Application/test.aspx;
//你要生成的ASPX文件
System.Net.WebRequest request = System.Net.WebRequest.Create(PageUrl);
System.Net.WebResponse response = request.GetResponse();
System.IO.Stream resStream = response.GetResponseStream();
System.IO.StreamReader sr = new System.IO.StreamReader(resStream, System.Text.Encoding.UTF8);
ContentHtml.Text = sr.ReadToEnd();
resStream.Close();
sr.Close();
string filename=System.DateTime.Now.ToString("yyyyMMddHHmmss");
System.IO.StreamWriter sw=new System.IO.StreamWriter("c:/"+filename+".htm",false,System.Text.Encoding.UTF8); //最后一个参数视实际需要
sw.WriteLine(ContentHtml.Text);
sw.Close();
Response.WriteFile("c:/"+filename+".htm");
}
{
string PageUrl = http://localhost/Application/test.aspx;
//你要生成的ASPX文件
System.Net.WebRequest request = System.Net.WebRequest.Create(PageUrl);
System.Net.WebResponse response = request.GetResponse();
System.IO.Stream resStream = response.GetResponseStream();
System.IO.StreamReader sr = new System.IO.StreamReader(resStream, System.Text.Encoding.UTF8);
ContentHtml.Text = sr.ReadToEnd();
resStream.Close();
sr.Close();
string filename=System.DateTime.Now.ToString("yyyyMMddHHmmss");
System.IO.StreamWriter sw=new System.IO.StreamWriter("c:/"+filename+".htm",false,System.Text.Encoding.UTF8); //最后一个参数视实际需要
sw.WriteLine(ContentHtml.Text);
sw.Close();
Response.WriteFile("c:/"+filename+".htm");
}