/// summary>
/// 获取URL访问的HTML内容 获取https 页面的
/// /summary>
/// param name="Url">URL地址/param>
/// returns>HTML内容/returns>
public static string GetWebContent(string Url, CookieContainer cookieContainer)
{
string strResult = "";
try
{
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url);
request.CookieContainer = cookieContainer;
request.Timeout = 30000;
request.Headers.Set("Pragma", "no-cache");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream streamReceive = response.GetResponseStream();
Encoding encoding = Encoding.GetEncoding("utf-8");
StreamReader streamReader = new StreamReader(streamReceive, encoding);
strResult = streamReader.ReadToEnd();
}
catch
{
}
return strResult;
}