C#System.Net.WebException:基础连接已关闭:上一个发送发生意外的错误。 [英] C# System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send.

查看:1202
本文介绍了C#System.Net.WebException:基础连接已关闭:上一个发送发生意外的错误。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到这个错误只是在一台服务器Windows Server 2003的任何想法?
我见过的其他职位,但没有明确的方案。



System.Net.WebException:基础连接已关闭:在发生意外的错误送。



下面是我的代码..任何想法????????

  HttpWebRequest的要求=(HttpWebRequest的)WebRequest.Create(https://开头的URL HERE); 
// request.Headers.Add(接受,应用程序/ XML);
字节[]字节;

字节= System.Text.Encoding.ASCII.GetBytes(XML);
request.KeepAlive = FALSE;
request.Accept =application / xml进行;
request.ContentType =application / xml进行的,字符集=utf-8';
request.ContentLength = bytes.Length;
request.Method =POST;
request.Timeout = 10000;
request.ServicePoint.Expect100Continue = FALSE;


解决方案

在客户端计算机不能​​发送一个出现此问题的HTTP请求。因为连接已关闭了客户端计算机不能​​发送HTTP请求或不可用。当客户端计算机发送大量数据可能会出现此问题。要解决此问题,请参阅分辨率A,D,E,F和O



https://support.microsoft.com/en-us/kb/915599


I'm getting this error just on 1 server Windows Server 2003. Any ideas? I've seen other posts but no clear solution

System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send.

Here's my code.. Any ideas????????

  HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://  URL HERE ");
            //       request.Headers.Add("Accept", "application/xml");
            byte[] bytes;

            bytes = System.Text.Encoding.ASCII.GetBytes(xml);
            request.KeepAlive = false;
            request.Accept = "application/xml";
            request.ContentType = "application/xml; charset='UTF-8'";
            request.ContentLength = bytes.Length;
            request.Method = "POST";
            request.Timeout = 10000;
            request.ServicePoint.Expect100Continue = false;

解决方案

This problem occurs when the client computer cannot send an HTTP request. The client computer cannot send the HTTP request because the connection has been closed or is unavailable. This problem may occur when the client computer is sending lots of data. To resolve this problem, see resolutions A, D, E, F, and O.

https://support.microsoft.com/en-us/kb/915599

这篇关于C#System.Net.WebException:基础连接已关闭:上一个发送发生意外的错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆