close
使用 WebClient 存取 https 網站時發生如下錯誤
基礎連接已關閉: 無法為 SSL/TLS 安全通道建立信任關係
The underlying connection was closed: Could not establish trust relationship for SSL/TLS secure channel
解決方式.
WebClient wc = new WebClient();
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
string HtmlCode = wc.DownloadString("https://xxx.xxx.xxx");
文章標籤
全站熱搜
留言列表