Click to See Complete Forum and Search --> : know when the computer is conect to the internet
the beholder
Nov 12th, 1999, 10:59 PM
i want that my program will know when the computer is conect to the internet (throw a command buton) soory about my tapy mistake i am from isreal so if u can tell me the source code it will be great tank you and have a nice day
------------------
yaniv garti
There is sample code on this site for exactly that, but YOU have to look for it. Check out "Topic Areas: Internet" and "Contents: Tips", OR the "Search" engine on this site.
kwnah
Nov 17th, 1999, 07:13 AM
I have try to search for that sample coding, but it doesn't work in Cablde MOdem and ISDN line......can you help ?
------------------
Jason Abraham
kwnah@technologist.com
kwnah
Nov 17th, 1999, 07:13 AM
I have try to search for that sample coding, but it doesn't work in Cablde MOdem and ISDN line......can you help ?
Aren't those types of connections always connected? Anyway, (it's been a while) but a crude way I've used is to add a Winsock control and call it's "Listen" method. Then check out the Local Port and Local IP. If they are both non-zero, then I believe that means you have an internet connection. Periodically you could close the socket and "Listen" again and recheck those Local properties.
I wrote a program using this technique to wait for my girlfriend to connect to the internet, then publish her IP and Port to my web site, while I would check my web site to see if the info was updated. Then I made a direct connection to her IP and Port and we would chat.
Hope that helps.
vbsquare
Nov 28th, 1999, 05:08 AM
Nice idea, but if you are on the network then it will return your current IP Address. At the moment, the best way is to actually try and open a url and see if it fails. http://www.mvps.org/vb
------------------
"To the glory of God!"
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.