基础连接已关闭:发送时发生意外错误。 [英] The underlying connection was closed: an unexpected error occurred on a send.
本文介绍了基础连接已关闭:发送时发生意外错误。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Visual Studio 2015
目标框架:.Net framework 4.5.2
当我执行我的项目时出现此错误底层连接已关闭:发送时发生意外错误。如果有人知道那么请回答
我尝试了什么:
I am using Visual studio 2015
Target Framework : .Net framework 4.5.2
when i am executing my project this error " The underlying connection was closed: An unexpected error occurred on a send." is throwing, please if any one know then answer
What I have tried:
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolTypeExtensions.Tls12;
i得到此代码更改,但不要在哪里更改
i got this code to change, but dont no where to change
推荐答案
将此指定行添加为以下代码。
SagePayDirectIntegration sagePayDirectIntegration = new SagePayDirectIntegration();
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
IDirectPayment request = sagePayDirectIntegration.DirectPaymentRequest();
您的问题将得到解决
Add this specified line as the below code.
SagePayDirectIntegration sagePayDirectIntegration = new SagePayDirectIntegration();
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
IDirectPayment request = sagePayDirectIntegration.DirectPaymentRequest();
your problem will be solved
这篇关于基础连接已关闭:发送时发生意外错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文