我正在开发一个 Windows 服务,它从特定的 URL 下载图像。该服务在我的计算机上正常运行,但是当我将其安装在服务器中时,它不会下载图像,并且出现以下错误:
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 212.100.220.117:80
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
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.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadData(Uri address)
at System.Net.WebClient.DownloadData(String address)
可能是什么原因导致该错误以及如何解决它?
我读了这一页:http://support.microsoft.com/kb/318140 http://support.microsoft.com/kb/318140
我不确定这是否是问题所在,如果是我应该在配置中编写什么代理。向您寻求建议。
我找到了答案。我正在尝试访问公共地址“http://mywebsite.com/images/ http://mywebsite.com/images/“来自服务器。而不是我使用托管网站的服务器的本地 IP,它现在可以工作了。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)