阅读背景:

解决C#中WebClient不能下载https内容问题

来源:互联网 

在下载代码之前加入如下代码:

// 解决WebClient不能通过https下载内容问题
System.Net.ServicePointManager.ServerCertificateValidationCallback +=
	delegate(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate,
	         System.Security.Cryptography.X509Certificates.X509Chain chain,
	         System.Net.Security.SslPolicyErrors sslPolicyErrors)
{
	return true; // **** Always accept
};// 解决WebClient不能通过https下载内容问题



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: