Click to See Complete Forum and Search --> : Detecting Internet Connection
Xero
Jun 25th, 2000, 10:31 AM
How do check if the internet is connected through my lan connection or modem?
mattbrown
Jun 25th, 2000, 12:29 PM
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
Xero
Jun 27th, 2000, 07:35 AM
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.
SteveCRM
Jul 1st, 2000, 01:11 PM
I kept getting errors in the module for that tip.
mattbrown
Jul 1st, 2000, 09:04 PM
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
SteveCRM
Jul 2nd, 2000, 11:03 AM
Thats the one I used but I couldn't get it to work. I got errors in the module all over the place.
mattbrown
Jul 2nd, 2000, 05:38 PM
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
mattbrown
Jul 2nd, 2000, 05:58 PM
There is a duplicate declaration in the start of the module
Remove the second instance of
Public Declare Function InternetGetConnectedState _
Lib "wininet.dll" (ByRef lpSFlags As Long, _
ByVal dwReserved As Long) As Long
and everything should work properly.
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
SteveCRM
Jul 2nd, 2000, 06:40 PM
Your kidding.....Thats it? IM GONNA KICK MYSELF!
Xero
Jul 2nd, 2000, 08:59 PM
I deleted the second instance of it before, and it still doesn't work correctly for me.
mattbrown
Jul 3rd, 2000, 12:55 AM
Exactly what error are you getting Xero?
Regards
SteveCRM
Jul 3rd, 2000, 10:02 AM
I just tried it and it works fine. What error are you getting?
Xero
Jul 7th, 2000, 11:43 PM
Thats the thing, I'm not getting any error. It just shows up the wrong values.
mattbrown
Jul 7th, 2000, 11:45 PM
Can you give some specifics?
What exactly are the wrong values?
What is your system configuration etc.
Regards
Xero
Jul 8th, 2000, 12:02 AM
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... ;)
mattbrown
Jul 8th, 2000, 12:06 AM
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
Xero
Jul 8th, 2000, 12:12 AM
Oh I see. Thanks anyway.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.