国产探花免费观看_亚洲丰满少妇自慰呻吟_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://www.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 關鍵詞,以為是公司網絡問題,于是下班之后在家里的網絡試了一下,

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

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

 

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

 

。。。。。。。。。

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

真是自己折磨自己啊 


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 德化县| 岳池县| 新巴尔虎左旗| 崇文区| 东至县| 武陟县| 洱源县| 高要市| 中超| 临澧县| 东阳市| 蒙山县| 曲麻莱县| 清流县| 嘉禾县| 衡东县| 古丈县| 新巴尔虎左旗| 龙井市| 特克斯县| 兰西县| 涿鹿县| 北碚区| 广灵县| 临澧县| 东兰县| 大关县| 岢岚县| 青岛市| 利川市| 应城市| 于田县| 外汇| 温宿县| 雅江县| 公主岭市| 永城市| 蓬安县| 台湾省| 吴忠市| 奈曼旗|