Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to know whether the system has internet behind proxy?

What I have tried:

My.Computer.Network.Ping("www.google.com")


It works well when proxy is not enabled.

If proxy settings is enabled it will always return false (when internet is available or not)
Posted
Updated 24-Feb-20 23:33pm
v2

1 solution

If you want to know whether http protocol is accessible, then test for a web request instead of a ping request. Ping is a distinct protocol from http and is often blocked by proxies.
Check Internet Connection vb.net - Stack Overflow[^]
 
Share this answer
 
Comments
kgmmurugesh 25-Feb-20 5:29am    
web request takes 20 seconds when internet is not available.
phil.o 25-Feb-20 6:27am    
Probably; because absence of service is only qualified after the request has reached its timeout.
kgmmurugesh 25-Feb-20 6:30am    
Ok. is there any way to check quickly?
phil.o 25-Feb-20 6:41am    
You could try to lower the timeout (I don't know how), but then you face an increased risk of false positives.
kgmmurugesh 25-Feb-20 6:42am    
Ok.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900