ASP.NET三代页面
1、模版
2、或者用芒果x生成html的方式,因为是在服务器端执行,所以速度还可以
函数:
/// <summary>
/// 三代页
/// </summary>
/// <param>源芒果x文件地址</param>
/// <param>目标html地址</param>
public void CreateHTML(string sourceurl, string url)
{
System.Net.WebRequest myRequest = System.Net.WebRequest.Create(sourceurl);
System.Net.WebResponse myResponse = myRequest.GetResponse();
Stream stream = myResponse.GetResponseStream();
StreamReader sr = new StreamReader(stream, Encoding.GetEncoding("gb2312"));
StreamWriter sw = new StreamWriter(HttpContext.Current.Server.MapPath(url), false, System.Text.Encoding.Default);
sw.WriteLine(sr.ReadToEnd());
sw.Close();
}
赞同
14
|
评论
0
0