string strr = 网页url;
ServicePointManager.ServerCertificateValidationCallback += RemoteCertificateValidate;//验证服务器证书回调自动验证
System.Net.WebClient client = new System.Net.WebClient();
string reply = string.Empty;
ServicePointManager.ServerCertificateValidationCallback += RemoteCertificateValidate;//验证服务器证书回调自动验证
System.Net.WebClient client = new System.Net.WebClient();
string reply = string.Empty;
reply = client.DownloadString(strr);
private static bool RemoteCertificateValidate(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error)
{
// trust any certificate!!!
//为了通过证书验证,总是返回true
return true;
}