Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to check Internet connection

How to check Internet connection

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tufail Ahmad
    wrote on last edited by
    #1

    In vb6.0, how can i check Internet connection. that is. Is net connected or not. Send source code please

    L I P 3 Replies Last reply
    0
    • T Tufail Ahmad

      In vb6.0, how can i check Internet connection. that is. Is net connected or not. Send source code please

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Tufail Ahmad wrote:

      Send source code please

      Private Declare Function InternetGetConnectedState Lib "wininet.dll" _
      (ByRef dwflags As Long, ByVal dwReserved As Long) As Long

      Public Function IsOnline() As Boolean
      Dim LFlags As Long
      IsOnline = InternetGetConnectedState(LFlags, 0&)
      End Function

      :)

      I are Troll :suss:

      T 1 Reply Last reply
      0
      • L Lost User

        Tufail Ahmad wrote:

        Send source code please

        Private Declare Function InternetGetConnectedState Lib "wininet.dll" _
        (ByRef dwflags As Long, ByVal dwReserved As Long) As Long

        Public Function IsOnline() As Boolean
        Dim LFlags As Long
        IsOnline = InternetGetConnectedState(LFlags, 0&)
        End Function

        :)

        I are Troll :suss:

        T Offline
        T Offline
        Tufail Ahmad
        wrote on last edited by
        #3

        IsOnline = InternetGetConnectedState(LFlags, 0&) In the above line, LFlags returns some values, what does it mean. Note: I am connected to Internet through LAN

        T 1 Reply Last reply
        0
        • T Tufail Ahmad

          IsOnline = InternetGetConnectedState(LFlags, 0&) In the above line, LFlags returns some values, what does it mean. Note: I am connected to Internet through LAN

          T Offline
          T Offline
          The Man from U N C L E
          wrote on last edited by
          #4

          Google is a wonderful thing. Check out InternetGetConnectedState Function on MSDN[^]. The LFlags result you are looking for is 2.

          If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles]  [My Website]

          1 Reply Last reply
          0
          • T Tufail Ahmad

            In vb6.0, how can i check Internet connection. that is. Is net connected or not. Send source code please

            I Offline
            I Offline
            i i i
            wrote on last edited by
            #5

            Private Const FLAG_ICC_FORCE_CONNECTION = &H1 Private Declare Function InternetCheckConnection Lib "wininet.dll" Alias "InternetCheckConnectionA" (ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Long Function Check_Internet_Connection() As Boolean If InternetCheckConnection("http://www.google.com", FLAG_ICC_FORCE_CONNECTION, 0&) = 0 Then Check_Internet_Connection = False Else Check_Internet_Connection = True End If End Function

            Best Regards, SOFTDEV If you have knowledge, let others light their candles at it

            1 Reply Last reply
            0
            • T Tufail Ahmad

              In vb6.0, how can i check Internet connection. that is. Is net connected or not. Send source code please

              P Offline
              P Offline
              Paul Conrad
              wrote on last edited by
              #6

              Tufail Ahmad wrote:

              Send source code please

              Sorry, it is not how this site works. People will offer help and hints as to what to do, but to just throw out code, no.

              "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups