将url网址的内容转换为html
using System.IO;
using System.Net;
private static string UrlToHtml(string url,System.Text.Encoding encode)
{
string strHtml = "<BASE HREF=\"" + url + "\"/>";
try
{
StreamReader sr;
WebRequest HttpWebRequest = WebRequest.Create(url);
WebResponse HttpWebResponse = HttpWebRequest.GetResponse();
sr = new StreamReader(HttpWebResponse.GetResponseStream(),encode);
strHtml += sr.ReadToEnd();
sr.Close();
}
catch
{}
finally
{}
return strHtml;
}