是否可以检测/重用这些设置?如何在.net中自动检测/使用IE代理设置HttpWebRequest
怎么样?
例外我得到是 这是例外,而连接到http://www.google.com
System.Net.WebException: Unable to connect to the remote server --->
System.Net.Sockets.SocketException: A connection attempt failed because the
connected party did not properly respond after a period of time, or established
connection failed because connected host has failed to respond 66.102.1.99:80
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress)
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure,
Socket s4, Socket s6, Socket& socket, IPAddress& address,
ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout,
Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
at mvcTest.MvcApplication.Application_Start() in
C:\\home\\test\\Application1\\Application1\\Program.cs:line 33"
如果你得到一个异常,请张贴整个事情:ex.ToString()。 – 2009-07-20 19:36:20
异常高于 – Kumar 2009-07-21 18:57:41
这更可能是防火墙问题。你只是没有获得连接。 – 2009-07-21 19:01:43