Results 1 to 15 of 15

Thread: Internet connected?

  1. #1

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    Internet connected?

    How can I detect if the computer is connected to internet (also please mention if I need any components)?
    "Quis custodiet ipsos custodes?"
    Juvenal
    Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
    I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
    -=Joey Jordison R0CKS!! =-

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Internet connected?

    you could just send a ping to your dns server

    rgds pete

  3. #3

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    Re: Internet connected?

    how??? Using "shell"?
    "Quis custodiet ipsos custodes?"
    Juvenal
    Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
    I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
    -=Joey Jordison R0CKS!! =-

  4. #4
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4700 x4
    Posts
    1,333

    Re: Internet connected?

    Yep...

    wouldn't something along the lines of

    Shell "ping www.google.com"

    work ?
    Zeegnahtuer?

  5. #5

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    Re: Internet connected?

    k but how can i check the results of ping?
    "Quis custodiet ipsos custodes?"
    Juvenal
    Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
    I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
    -=Joey Jordison R0CKS!! =-

  6. #6
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4700 x4
    Posts
    1,333

    Re: Internet connected?

    To tell you the truth i diodn't think of that... damnit, no point if you can't check it... lol

    Erm, wait til the other guy gets back in here, he should know
    Zeegnahtuer?

  7. #7

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    Re: Internet connected?

    yep.. nice sig by the way
    "Quis custodiet ipsos custodes?"
    Juvenal
    Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
    I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
    -=Joey Jordison R0CKS!! =-

  8. #8
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4700 x4
    Posts
    1,333

    Re: Internet connected?

    Quote Originally Posted by kill_bill_gates
    yep.. nice sig by the way
    lol, ty

    I wonder if this has been asked B4 u kno, i'm, sure it has, do a search there should be a few examples...
    Zeegnahtuer?

  9. #9
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879

    Re: Internet connected?

    There's massive threads about this. Many ways to do it. The problem is, some of the methods initiate a connection attempt, which maybe unwanted. On the other hand, if you don't want to initiate a connection attempt, then you must use tons of code (that have already been composed by other people) that will check to see if there is an internet connection Cable/DSL/Dial up.
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  10. #10
    Lively Member Misspell's Avatar
    Join Date
    Mar 2002
    Location
    Located
    Posts
    69

    Re: Internet connected?

    Ping, write the results to text file, then phase through flie for results.
    VB Code:
    1. Shell "cmd /k ping google.com >c:\ping_test.txt ", vbHide

    Its in the forum somwhere, thats where i got the code above form.


    _

    ~ What was once an opinion, became a fact, to be later proven wrong... ~

  11. #11

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    Re: Internet connected?

    Thanks dude
    "Quis custodiet ipsos custodes?"
    Juvenal
    Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
    I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
    -=Joey Jordison R0CKS!! =-

  12. #12
    Lively Member Misspell's Avatar
    Join Date
    Mar 2002
    Location
    Located
    Posts
    69

    Re: Internet connected?

    Wellcome

    ~ What was once an opinion, became a fact, to be later proven wrong... ~

  13. #13
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Internet connected?

    Quote Originally Posted by kill_bill_gates
    How can I detect if the computer is connected to internet (also please mention if I need any components)?
    You need to use some api to get the state of your current connection. There are few different approches that could be used so here is the simplest one:
    VB Code:
    1. Private Const INTERNET_CONNECTION_CONFIGURED = &H40
    2. Private Const INTERNET_CONNECTION_LAN = &H2
    3. Private Const INTERNET_CONNECTION_MODEM = &H1
    4. Private Const INTERNET_CONNECTION_OFFLINE = &H20
    5. Private Const INTERNET_CONNECTION_PROXY = &H4
    6. Private Const INTERNET_RAS_INSTALLED = &H10
    7. Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpdwFlags As Long, ByVal dwReserved As Long) As Long
    8. Private Sub Form_Load()
    9.     'KPD-Team 2001
    10.     'URL: [url]http://www.allapi.net/[/url]
    11.     'E-Mail: [email]KPDTeam@Allapi.net[/email]
    12.     Dim Ret As Long
    13.     Me.AutoRedraw = True
    14.     'retrieve the connection status
    15.     InternetGetConnectedState Ret, 0&
    16.     'show the result
    17.     If (Ret And INTERNET_CONNECTION_CONFIGURED) = INTERNET_CONNECTION_CONFIGURED Then Me.Print "Local system has a valid connection to the Internet, but it may or may not be currently connected."
    18.     If (Ret And INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN Then Me.Print "Local system uses a local area network to connect to the Internet."
    19.     If (Ret And INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM Then Me.Print "Local system uses a modem to connect to the Internet."
    20.     If (Ret And INTERNET_CONNECTION_OFFLINE) = INTERNET_CONNECTION_OFFLINE Then Me.Print "Local system is in offline mode."
    21.     If (Ret And INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY Then Me.Print "Local system uses a proxy server to connect to the Internet."
    22.     If (Ret And INTERNET_RAS_INSTALLED) = INTERNET_RAS_INSTALLED Then Me.Print "Local system has RAS installed."
    23. End Sub

  14. #14

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    Re: Internet connected?

    wow, thanks rhino
    "Quis custodiet ipsos custodes?"
    Juvenal
    Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
    I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
    -=Joey Jordison R0CKS!! =-

  15. #15

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