在程序中獲取某個https網址的源碼,GetRespose()時
C# 基礎連接已經關閉: 發送時發生錯誤 C# 基礎連接已經關閉: 發送時發生錯誤
出現了“基礎連接已經關閉: 發送時發生錯誤。”的錯誤提示。
翻了論壇後,有個仁兄說:
//.net 4.0 設置: ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
//.net 4.5 設置: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls1.2;
自己寫的程序,是.net4.0的
於是寫了上邊這句,就好了。
原因雖然沒搞清楚。但體會很深。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
【SQL進階】CASE語句的使用
金大鑫要堅持
2024-05-30 14:29:54
blog-auto-publishing-tools博客自動發佈工具
https://github.com/ddean2009/blog-auto-publishing-tools
hiningrise
2024-05-30 14:28:04
微服務新體驗之Aspire初體驗
hiningrise
2024-05-30 14:28:04
第七節:RabbitMq延遲隊列實操(死信交換機+TTL)和死信插件的使用
一. 二. 三. ! 作 者 : Yaopengfei(姚鵬飛) 博客地址 : http://www.cnblogs.com
Yaopengfei
2024-05-30 14:24:33
flask 配合 sqlite3 維護數據庫的數據方法
張博的博客
2024-05-30 14:22:53
C#去除時間格式化之後中間的T字母
興想事成
2024-05-30 14:22:43
國外lead,聯盟常用名詞解釋
weiooo
2024-05-30 14:22:03
python3.x中ORM框架SQLObject使用SQLite數據庫隨筆
銘久
2024-05-30 14:21:53
npm error Cannot read properties of null (reading 'isDescendantOf')
阿 軍
2024-05-30 14:18:13
error in ./node_modules/@intlify/core-base/dist/core-base.cjs
ERROR Failed to compile with 1 error
阿 軍
2024-05-30 14:18:13
optional install error: Error: Unsupported URL Type: npm:vue-loader@^16.1.0
阿 軍
2024-05-30 14:18:13
request to https://registry.npm.taobao.org/cnpm failed, reason: certificate has expired
阿 軍
2024-05-30 14:18:13
nvidia-smi版本驅動不匹配,以及 cuda不可用兩個問題處理
馬昌偉
2024-05-30 14:16:52