国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

AnexceptionoccurredduringaWebClientrequest

2019-11-14 16:06:09
字體:
來源:轉載
供稿:網友

System.Net.WebException was caught
HResult=-2146233079
Message=An exception occurred during a WebClient request.
Source=System
StackTrace:
at System.Net.WebClient.OpenRead(Uri address)
at System.Net.WebClient.OpenRead(String address)
at Client.PRogram.GetAllEmployees(String contentType, String accept) in h:/幫助頁面與自動消息格式(JSONxml)選擇/Client/Program.cs:line 62
InnerException: System.Configuration.ConfigurationErrorsException
HResult=-2146232062
Message=Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section.
Source=System
BareMessage=Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section.
Line=0
StackTrace:
at System.Net.Configuration.DefaultProxySectionInternal.GetSection()
at System.Net.WebRequest.get_InternalDefaultWebProxy()
at System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint)
at System.Net.HttpRequestCreator.Create(Uri Uri)
at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
at System.Net.WebRequest.Create(Uri requestUri)
at System.Net.WebClient.GetWebRequest(Uri address)
at System.Net.WebClient.OpenRead(Uri address)
InnerException: System.Net.Sockets.SocketException
HResult=-2147467259
Message=An invalid argument was supplied
Source=System
ErrorCode=10022
NativeErrorCode=10022
StackTrace:
at System.Net.SafeCloseSocketAndEvent.CreateWSASocketWithEvent(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, Boolean autoReset, Boolean signaled)
at System.Net.NetworkAddressChangePolled..ctor()
at System.Net.AutoWebProxyScriptEngine.AutoDetector.Initialize()
at System.Net.AutoWebProxyScriptEngine.AutoDetector.get_CurrentAutoDetector()
at System.Net.AutoWebProxyScriptEngine..ctor(WebProxy proxy, Boolean useRegistry)
at System.Net.WebProxy.UnsafeUpdateFromRegistry()
at System.Net.WebProxy..ctor(Boolean enableAutoproxy)
at System.Net.Configuration.DefaultProxySectionInternal..ctor(DefaultProxySection section)
at System.Net.Configuration.DefaultProxySectionInternal.GetSection()
InnerException:

 

上述的錯誤來自于下面的代碼:

 WebClient webClient = new WebClient();                             var stream = webClient.OpenRead("http://m.survivalescaperooms.com/");                using (StreamReader reader = new StreamReader(stream))                {                    Console.WriteLine(reader.ReadToEnd());                }

  

上面的錯誤讓我糾結了好久,僅僅是一個簡單的webclient請求,怎么都不通??

百度了一個辦法?

http://codebender.denniland.com/system-net-webexception-an-exception-occurred-during-a-webclient-request/

試了,還是不行,看到了system.net/defaultProxy 關鍵詞,以為是公司網絡問題,于是下班之后在家里的網絡試了一下,

竟然代碼通過了,所以我的懷疑是沒問題的,

但是畢竟要在公司開發啊,回到公司,果然錯誤依舊

 

然后找了同事幫我看,看著看著 ,靈機一動 我想起來了,代碼不是放在本地,是放在一個共享里,

 

。。。。。。。。。

這個錯誤的原因來的太糾結了,果然 把代碼拷貝到本地,錯誤也就沒了,

真是自己折磨自己啊 


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 余庆县| 炉霍县| 水富县| 贵阳市| 措勤县| 邢台市| 丘北县| 石狮市| 拜泉县| 南安市| 全州县| 蒲城县| 陵川县| 寿阳县| 扶沟县| 德兴市| 子洲县| 宁蒗| 竹山县| 英吉沙县| 阳泉市| 简阳市| 成武县| 广丰县| 海盐县| 农安县| 揭西县| 扶沟县| 景泰县| 武乡县| 建德市| 台南市| 读书| 湘潭市| 新和县| 甘德县| 莱阳市| 阳江市| 乌鲁木齐市| 红安县| 新民市|