Hello all
How I can detect whether my comp connected to internet or not (using C #)
thank you
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Dec 20, 2009, 12:03 PM
Effective way of check it is using WIN API function GetConnectedState() as Ping might not work in some situation ..
[DllImport("WININET", CharSet=CharSet.Auto)]
public static extern bool InternetGetConnectedState( ref InternetConnectionState lpdwFlags, int dwReserved );
after defining function just use it like normal function it will return True if Computer is connected
else it will return False .
Sam HobbsPosted Dec 20, 2009, 11:11 AM