开发者

Ping against IE - request timed out

Where to look what could be a cause that "ping IP_address" returns "Request timed out", but opening "http://IP_address" in the Internet Explorer loads site correctly?

And in real impication: .NET making WebRequest to that IP works correctly on my machine, but does not work on clietn's.

I think there should be something with proxy, but not sure what should be done. The .NET code is below:

WebRequest request = WebRequest.Create("http://tycho.usno.navy.mil/cgi-bin/timer.pl");开发者_StackOverflow
WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultCredentials;
request.CachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
request.Proxy = WebRequest.DefaultWebProxy;
WebResponse response = request.GetResponse();


Some servers block ping requests.


Some servers/ firewall/ gateway will block PING ( ICMP Request ), resulting in Request Timed Out; while loading a web page uses port 80 ( in most cases ), which is different than ICMP port .

UPDATE: According to your information given, you mentioned your codes WORK during debugging but does not work in a "Release" EXE, right? By default, during debugging session, the program bypasses most security settings.

Also, check Windows Firewall settings. Try disabling the Windows Firewall on client side & retry. If Windows Firewall is the culprit, add your program to Windows Firewall "Allowed Program" list and re-enable the Firewall.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜