Detect network connection?
-
Is there a way for a program to know when a network connection has been made? Ideally, I'd like to know when a certain interface is connected (I don't have to know when it was connected, just if it currently is physically connected). It seems as though XP can detect this since it has tray icons for this. Any idea how they are doing it?
-
Is there a way for a program to know when a network connection has been made? Ideally, I'd like to know when a certain interface is connected (I don't have to know when it was connected, just if it currently is physically connected). It seems as though XP can detect this since it has tray icons for this. Any idea how they are doing it?
If you only have to run on servers, you might be interested in the Network Monitor API: Network Monitor captures network traffic for display and analysis. It enables you to perform tasks such as analyzing previously captured data in user-defined methods and extract data from defined protocol parsers. No shirt, no shoes, no brains, no service.
-
Is there a way for a program to know when a network connection has been made? Ideally, I'd like to know when a certain interface is connected (I don't have to know when it was connected, just if it currently is physically connected). It seems as though XP can detect this since it has tray icons for this. Any idea how they are doing it?
InternetGetConnectedState
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!
-
Is there a way for a program to know when a network connection has been made? Ideally, I'd like to know when a certain interface is connected (I don't have to know when it was connected, just if it currently is physically connected). It seems as though XP can detect this since it has tray icons for this. Any idea how they are doing it?
Thanks guys - I don't think either one will work though. The reason why InternetGetConnectedState won't work is that it seems to only detect if a connection to the internet is found. This won't be true since by default, any new PC will not be allowed to connect to the internet from within our building (MAC filtering). What I need is a way to determine if the connection is good for a particular interface. Similar to what the connection status icon does in XP. For now, I'm using a ping to our server name. I guess it's about as good as I will be able to do. If anyone has a better suggestion, please let me know.
-
Is there a way for a program to know when a network connection has been made? Ideally, I'd like to know when a certain interface is connected (I don't have to know when it was connected, just if it currently is physically connected). It seems as though XP can detect this since it has tray icons for this. Any idea how they are doing it?
Is this of any help?
"Take only what you need and leave the land as you found it." - Native American Proverb
-
Is there a way for a program to know when a network connection has been made? Ideally, I'd like to know when a certain interface is connected (I don't have to know when it was connected, just if it currently is physically connected). It seems as though XP can detect this since it has tray icons for this. Any idea how they are doing it?