How do check if the internet is connected through my lan connection or modem?
Printable View
How do check if the internet is connected through my lan connection or modem?
I believe there is a code snippet for this posted in the tips area of this site.
Do a search and you should find it
Regards
Unfortunatly, I tried that already and it doesn't work right! It always says True for being Online, and True for being connected Online thru Lan. Thanks anyway.
I kept getting errors in the module for that tip.
http://www.vb-world.net/internet/tip467.html
Is the correct tip
There are others there as well but they do not handle LAN connectivity
Regards
Thats the one I used but I couldn't get it to work. I got errors in the module all over the place.
Hmmmmm,
I triedabout 5 months ago and it worked fine on a computer with a LAN and Modem connection. I'll have a look at it now.
I've only got a modem connection available to me here, so i can't vouch for the LAN side of it.
Catch you soon
Regards
There is a duplicate declaration in the start of the module
Remove the second instance of
and everything should work properly.Code:Public Declare Function InternetGetConnectedState _
Lib "wininet.dll" (ByRef lpSFlags As Long, _
ByVal dwReserved As Long) As Long
I ran it and got True for online() True for viaModem() and False for viaLAN() which is correct for my computer. I can send you the project I made if you would like
Regards
Your kidding.....Thats it? IM GONNA KICK MYSELF!
I deleted the second instance of it before, and it still doesn't work correctly for me.
Exactly what error are you getting Xero?
Regards
I just tried it and it works fine. What error are you getting?
Thats the thing, I'm not getting any error. It just shows up the wrong values.
Can you give some specifics?
What exactly are the wrong values?
What is your system configuration etc.
Regards
As I said before, it always returns Online as True and Lan as True and Modem as False. I'm connected through Windows Proxy Server(the one that comes with Windows98 SE and Win2k). I'm using Windows 2000, btw.
And any other specs I don't believe pertain to the problem, other than that the modem on the server computer is 56k, but that shouldn't mean anything.
My current believe is that is has not been tested in Win2k, but I cannot be sure.
Anyway, I'm gonna go to bed now... 1:05 Am... ack... I gotta learn to sleep when I'm supposed too... ;)
That would be a correct response then.
Unless the modem is physically connected to your computer you are technically accessing the internet over a LAN.
The way I see it your computer is connected through a network card to a server which has a modem connected to the internet. Correct?
This module only returns the status for your computer.
If you want to find out what type of connection is behind the proxy you will have to employ other means
Regards
Oh I see. Thanks anyway.