C# HttpWebRequest 获取 HTTPS 网页内容

2025-05-10 07:22:27
推荐回答(1个)
回答1:

if (uri.Scheme == "https") ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; });加上这句