Detecting a Net connection
-
How can you easily test for an active TCP connection (either LAN or DialUp). I would like to be able to check this in my code, so I can then connect or offer the user an option to dial-up - the same as in IE when it starts up. Surely there is a simple way to do this?
-
How can you easily test for an active TCP connection (either LAN or DialUp). I would like to be able to check this in my code, so I can then connect or offer the user an option to dial-up - the same as in IE when it starts up. Surely there is a simple way to do this?
Check out
InternetGetConnectedState()
on MSDN. Cheers, Paolo. -
How can you easily test for an active TCP connection (either LAN or DialUp). I would like to be able to check this in my code, so I can then connect or offer the user an option to dial-up - the same as in IE when it starts up. Surely there is a simple way to do this?
You can check for open PPP-(Point To Point Protocol) connections by calling RasEnumConnections() (see help for params). The function will return the number of active connections. If there is none, you can dial up one by calling RasDial(). Hope this will help you. --- Pseudocode is code to demonstrate a concept, not designed to be run. Like certain Microsoft software. (Thanks a lot who ever wrote Robert's Perl Tutorial)