ServicePointManager 類


地址:https://docs.microsoft.com/zh-cn/dotnet/api/system.net.servicepointmanager?redirectedfrom=MSDN&view=netframework-4.7.2

 

管理 ServicePoint 對象集合。

下面的代碼示例創建 ServicePoint 對象以連接到 URI www.contoso.com

Uri myUri = new Uri("http://www.contoso.com/");
 
ServicePoint mySP = ServicePointManager.FindServicePoint(myUri);

 

ServicePointManager 是一個靜態類,用來創建、維護和刪除 ServicePoint 類的實例。

當應用程序通過 ServicePointManager 對象請求與 Internet 資源統一資源標識符(URI)的連接時,ServicePointManager 將返回一個 ServicePoint 對象,其中包含由 URI 標識的主機和方案的連接信息。 如果該主機和方案存在現有 ServicePoint 對象,則 ServicePointManager 對象返回現有 ServicePoint 對象;否則,ServicePointManager 對象會創建一個新的 ServicePoint 對象。

4.6 .NET Framework 包括一項新的安全功能,用於阻止連接的不安全密碼和哈希算法。 默認情況下,通過 Api (例如 HttpClientHttpWebRequestFtpWebRequestSmtpClient、4.6 SslStream等)使用 TLS/SSL 的應用程序將獲得更安全的行為。

開發人員可能需要選擇退出此行為,以便與現有的 SSL3 服務或具有 RC4 服務的 TLS 保持互操作性。 本文介紹如何修改代碼,以便禁用新行為。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM