在程序中获取某个https网址的源码,GetRespose()时

出现了“基础连接已经关闭: 发送时发生错误。”的错误提示。
翻了论坛后,有个仁兄说:
                //.net 4.0 设置: ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
                //.net 4.5 设置: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls1.2;
 
自己写的程序,是.net4.0的
于是写了上边这句,就好了。
原因虽然没搞清楚。但体会很深。

相关文章:

  • 2022-12-23
  • 2022-01-08
  • 2022-01-27
  • 2021-11-12
  • 2021-12-31
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案