Results 1 to 17 of 17

Thread: Detecting Internet Connection

  1. #1

    Thread Starter
    Lively Member Xero's Avatar
    Join Date
    Feb 2000
    Posts
    75
    How do check if the internet is connected through my lan connection or modem?

  2. #2
    Addicted Member
    Join Date
    Aug 1999
    Location
    Hamilton, New Zealand
    Posts
    137
    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

    Regards

    Matt Brown
    Hamilton, NZ
    VB6 C++ in Visual Studio 6sp4
    VB.net Beta 1

  3. #3

    Thread Starter
    Lively Member Xero's Avatar
    Join Date
    Feb 2000
    Posts
    75
    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.

  4. #4
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    I kept getting errors in the module for that tip.

  5. #5
    Addicted Member
    Join Date
    Aug 1999
    Location
    Hamilton, New Zealand
    Posts
    137

    Make sure you are looking at the right 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

    Regards

    Matt Brown
    Hamilton, NZ
    VB6 C++ in Visual Studio 6sp4
    VB.net Beta 1

  6. #6
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    Unhappy

    Thats the one I used but I couldn't get it to work. I got errors in the module all over the place.

  7. #7
    Addicted Member
    Join Date
    Aug 1999
    Location
    Hamilton, New Zealand
    Posts
    137

    I'll have a look at the code

    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

    Regards

    Matt Brown
    Hamilton, NZ
    VB6 C++ in Visual Studio 6sp4
    VB.net Beta 1

  8. #8
    Addicted Member
    Join Date
    Aug 1999
    Location
    Hamilton, New Zealand
    Posts
    137

    Exclamation Duplicate Declaration

    There is a duplicate declaration in the start of the module

    Remove the second instance of
    Code:
    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
    Regards

    Matt Brown
    Hamilton, NZ
    VB6 C++ in Visual Studio 6sp4
    VB.net Beta 1

  9. #9
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    Your kidding.....Thats it? IM GONNA KICK MYSELF!

  10. #10

    Thread Starter
    Lively Member Xero's Avatar
    Join Date
    Feb 2000
    Posts
    75
    I deleted the second instance of it before, and it still doesn't work correctly for me.

  11. #11
    Addicted Member
    Join Date
    Aug 1999
    Location
    Hamilton, New Zealand
    Posts
    137

    Red face Hmmmmm

    Exactly what error are you getting Xero?

    Regards
    Regards

    Matt Brown
    Hamilton, NZ
    VB6 C++ in Visual Studio 6sp4
    VB.net Beta 1

  12. #12
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    What error are you getting?

    I just tried it and it works fine. What error are you getting?

  13. #13

    Thread Starter
    Lively Member Xero's Avatar
    Join Date
    Feb 2000
    Posts
    75
    Thats the thing, I'm not getting any error. It just shows up the wrong values.

  14. #14
    Addicted Member
    Join Date
    Aug 1999
    Location
    Hamilton, New Zealand
    Posts
    137
    Can you give some specifics?

    What exactly are the wrong values?

    What is your system configuration etc.

    Regards
    Regards

    Matt Brown
    Hamilton, NZ
    VB6 C++ in Visual Studio 6sp4
    VB.net Beta 1

  15. #15

    Thread Starter
    Lively Member Xero's Avatar
    Join Date
    Feb 2000
    Posts
    75
    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...

  16. #16
    Addicted Member
    Join Date
    Aug 1999
    Location
    Hamilton, New Zealand
    Posts
    137
    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

    Regards

    Matt Brown
    Hamilton, NZ
    VB6 C++ in Visual Studio 6sp4
    VB.net Beta 1

  17. #17

    Thread Starter
    Lively Member Xero's Avatar
    Join Date
    Feb 2000
    Posts
    75
    Oh I see. Thanks anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width