Friday, December 09, 2005

Checking if you are connected to the internet

I have not tested this but it looks legit:

[DllImport("wininet.dll")]private extern static bool InternetGetConnectedState (out int connectionDescription, int reservedValue ) ;

public bool IsConnected() {
int connectionDescription = 0;
return InternetGetConnectedState(out connectionDescription, 0);
}

0 Comments:

Post a Comment

<< Home