为什么不能生成静态页面?
下面是我的方法,这个方法在本地可能将网上任何一个页面生成静态页面,
但是放在服务器上就生成不了,发现不能 getUrltoHtml(string Url)
方法得不到网页的Html代码
/// <summary>
/// 传入URL返回网页的html代码
/// </summary>
/// <param name= "Url "> URL </param>
/// <returns> </returns>
public string getUrltoHtml(string Url)
{
string errorMsg = " ";
string resultHtml = " ";
//try
//{
System.Net.WebRequest wReq = System.Net.WebRequest.Create(Url);
// Get the response instance.
System.Net.WebResponse wResp = wReq.GetResponse();
// Get the response stream.
System.IO.Stream respStream = wResp.GetResponseStream();
// Dim reader As StreamReader = New StreamReader(respStream).Encoding.GetEncoding( "gb2312 ")
System.IO.StreamReader reader = new System.IO.StreamReader(respStream, System.Text.Encoding.UTF8);
resultHtml= reader.ReadToEnd();
reader.Close();
reader.Dispose();
//}
//catch (
System.Exception ex)
&