HttpWebRequest 多次请求不同网站时,由于安全协议问题。提示错误 “The underlying connection was closed: An unexpected error occurred on a send.”(基础连接已关闭:发送时发生意外错误)
记录解决方法
//.net 4.0 设置: ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
//.net 4.5 设置: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls1.2;