Announcement

Collapse
No announcement yet.

Proper Include file

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Proper Include file

    Hello
    The aim of the below program is to check if there is a proper internet connection
    I tried compiling the below program but gotten an error message
    " Missing declaration: ISINTERNETCONNECTED
    Line 14: iResult = IsInternetConnected(URL) "


    Code:
    #COMPILE EXE
    #DIM ALL
     #INCLUDE ONCE "Win32API.inc"
     #INCLUDE "WININET.INC"
    
    
    FUNCTION PBMAIN () AS LONG
    
    DIM iResult AS LONG
    DIM URL AS LOCAL STRING
    
    
     URL = "www.google.com"
       iResult = IsInternetConnected(URL)
           IF iResult THEN
                  ?  " internet ok"
         ELSE
             ?  "An internet connection is not available."
        END IF
    
    END FUNCTION
    Looks like the include files are wrong for the IsInternetConnected() function.
    hence what w'd be the correct include file ?

    regards
    chris


  • #2
    Where did you get that source from?

    Looks like you have to roll your own way of calling that Function.

    From MSDN:

    This API uses NCSI and the Network Location Manager (NLM) to determine a "best guess" regarding the Internet connectivity of the current user. Even if S_OK is returned, there is no guarantee that the user will be able to contact a specific Internet address.

    An import library containing the IsInternetConnected function is not included in the Microsoft Windows Software Development Kit (SDK). Applications must use the GetModuleHandle and GetProcAddress functions to retrieve the function pointer from the corresponding DLL and call this function.

    Comment


    • #3
      Well, MSDN tells us that there is a Library missing from the SDK:
      An import library containing the IsInternetConnected function is not included in the Microsoft Windows Software Development Kit (SDK). Applications must use the GetModuleHandle and GetProcAddress functions to retrieve the function pointer from the corresponding DLL and call this function.
      GetModuleHandle is in WinBase.inc
      GetProcAddress is in that inc file as well, with possibly more info in ShlWAPI.inc lines 3012 and 3047, and in HTMLHELP.inc at line 362. There were hits in InitCrtl.inc as well.
      Well someone beat me to it!
      https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx
      Rod
      "To every unsung hero in the universe
      To those who roam the skies and those who roam the earth
      To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

      Comment


      • #4
        Hi Chris,


        Code:
        DECLARE FUNCTION IsInternetConnected IMPORT "Connect.dll" ALIAS "IsInternetConnected" () AS LONG

        Returns %S_OK ( = 0) for "yes, is connected" and %S_FALSE ( = 1) for "no, isn´t connected"


        JK

        Comment


        • #5
          Thanks everyone, thought I'd test it.

          Neither Jose Roca includes or PB includes have this declare statement

          https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx
          This says GetModuleHandle and GetProAddress must be used, but ssample below worked fine.

          'Discussed in 2002
          https://forum.powerbasic.com/forum/u...ernetconnected

          Tested here by disabling ethernet adapter in software and it worked.
          Tested here by disconnected cable and it worked.
          Tested by unplugging wifi adapter and it worked.
          Passed all tests here.
          Code:
          DECLARE FUNCTION IsInternetConnected IMPORT "Connect.dll" ALIAS "IsInternetConnected" () AS LONG
          FUNCTION PBMAIN () AS LONG
           IF ISFALSE(IsInternetConnected) THEN
            ? "connected",,"No error"
           ELSE
            ? "not connected",%MB_ICONERROR,"Error"
           END IF
          END FUNCTION
          https://duckduckgo.com instead of google

          Comment


          • #6
            Hi Mike,


            MSDN says there is no import library for this API function available. C compilers need import libraries (.lib files) for implicitly (automatically) loading a dll, PB doesn´t. A correct "DECLARE" statement is enough.


            JK

            Comment


            • #7
              Thanxx a lot Everyone.

              But it is not that reliable as when I unplucked the ethernet cable off my switch, and with my switch still turn on
              it still detect that "Internet is ok".
              Maybe it detects that the LAN connection is still on and give a false positive results?

              Only after a few tries after that, it finally detected that the internet is not available.

              Comment


              • #8
                All,
                To get a more immediate and accurate result wouldn't you need to try to access a website first. That way the connection status gets updated based on that simple test. I assume that function merely reports the current status based on the prior attempts to access the LAN or WAN.

                Comment


                • #9
                  When in doubt, read the manual?

                  https://msdn.microsoft.com/en-us/lib...=vs.85%29.aspx

                  Comment


                  • #10
                    All,
                    I first find the MAC address. That will tell you that your machine is connected to a network.

                    Code:
                    #COMPILE EXE
                    #DIM ALL
                    
                    #INCLUDE ONCE "WIN32API.INC"
                    #INCLUDE ONCE "COMMCTRL.INC"
                    #INCLUDE ONCE "COMDLG32.INC"
                    
                    #INCLUDE ONCE "IpHlpApi.inc"
                    
                    TYPE IP_ADAPTER_INF
                      pNext               AS IP_ADAPTER_INFO PTR
                      ComboIndex          AS DWORD
                      AdapterName         AS STRING * (%MAX_ADAPTER_NAME_LENGTH + 4)
                      Description         AS STRING * (%MAX_ADAPTER_DESCRIPTION_LENGTH + 4)
                      AddressLength       AS DWORD
                      Address(0 TO %MAX_ADAPTER_ADDRESS_LENGTH - 1) AS BYTE
                      Index               AS DWORD
                      uType               AS DWORD
                      DhcpEnabled         AS DWORD
                      CurrentIpAddress    AS IP_ADDR_STRING PTR
                      IpAddressList       AS IP_ADDR_STRING
                      GatewayList         AS IP_ADDR_STRING
                      DhcpServer          AS IP_ADDR_STRING
                      HaveWins            AS LONG
                      PrimaryWinsServer   AS IP_ADDR_STRING
                      SecondaryWinsServer AS IP_ADDR_STRING
                      LeaseObtained       AS LONG
                      LeaseExpires        AS LONG
                    END TYPE
                    
                    
                    DECLARE FUNCTION MacAddressGet(MacAddress() AS STRING)AS LONG
                    DECLARE FUNCTION GetMACaddressName(szIP AS STRING) AS STRING
                    DECLARE FUNCTION GetNetworkAndWebParameters (Local_Hostname AS STRING, _
                                                                 Local_Ip AS STRING, _
                                                                 Client_IP AS STRING, _
                                                                 Client_IPAndServer AS STRING) AS LONG
                    
                    
                    FUNCTION PBMAIN () AS LONG
                    
                       ? FindMACAddress
                    
                    END FUNCTION
                    
                    '_________________________________________________________________
                    '
                    '   FUNCTION  GetNetworkandWebParameters
                    '_________________________________________________________________
                    
                    FUNCTION GetNetworkandWebParameters (Local_Hostname AS STRING, _
                                                         Local_Ip AS STRING, _
                                                         Client_IP AS STRING, _
                                                         Client_IPAndServer AS STRING) AS LONG
                    
                         ' This function returns all 4 values or a message indicating if any hasn't
                         ' being found.
                         LOCAL Temp AS STRING
                    
                         ' First get local computer name
                         HOST NAME TO Local_Hostname$
                         ' Next find out the IP of the socket connected to Internet or a network
                         IF Dot_IP (Local_Hostname) = "127.0.0.1" THEN
                            Local_IP$ = "No Connection to Internet or local network found."
                         ELSE
                            Local_IP$ = Dot_IP (Local_Hostname)
                         END IF
                    
                         Temp$ = GetPublicIPAddressAndISP ()
                    
                         IF Temp$ <> "FALSE" THEN
                              IF LEFT$(Local_IP$,2) <> "No" THEN Local_IP$ = Local_IP$ + " (Local Intranet IP)
                              Client_IP = Temp$
                         ELSE
                              IF LEFT$(Local_IP$,2) <> "No" THEN Local_IP$ = Local_IP$ + " (Local NetWork IP)
                              Client_IP = "No Client IP Found!"
                         END IF
                    
                    
                    END FUNCTION
                    
                    '_________________________________________________________________
                    '
                    '   FUNCTION  GetPublicIPAddressAndISP
                    '_________________________________________________________________
                    
                    FUNCTION GetPublicIPAddressAndISP() AS STRING
                    
                       ' Code taken mostly from the TCP OPEN example in the PB Help
                       ' and http://www.powerbasic.com/support/pbforums/showthread.php?t=44603
                    
                       'Return dotted public ip address from checkip.dyndns.com
                       'Put 80 in PortNumber to lookup on primary port or 8245 for secondary
                    
                       LOCAL buffer, temp, site AS STRING
                       LOCAL StartByte, LastByte, nSocket, PortNumber AS LONG
                       Site  = "checkip.dyndns.com"
                       PortNumber = 8245
                    
                       nSocket = FREEFILE
                       TCP OPEN PORT PortNumber AT site AS nSocket TIMEOUT 5000
                       IF ERR THEN EXIT FUNCTION
                    
                       TCP PRINT nSocket, "GET " & " HTTP/1.0"
                       TCP PRINT nSocket, "Accept: */*"
                       TCP PRINT nSocket, "Accept-Language: en-us"
                       TCP PRINT nSocket, "Host: " & site
                       TCP PRINT nSocket, "Pragma: no-cache"
                       TCP PRINT nSocket, "Referer: URL=http://www.MySite.com"
                       TCP PRINT nSocket, "User-Agent: MySite.com"
                       TCP PRINT nSocket, ""
                    
                       DO
                          TCP RECV nSocket, 4096, buffer
                          temp = temp & buffer
                       LOOP UNTIL LEN(Buffer) = 0 OR ERRCLEAR
                       TCP CLOSE nSocket
                    
                       'Hard-coded to only work with checkip.dyndns.com!
                       StartByte = INSTR(UCASE$(temp),"<BODY>CURRENT IP ADDRESS: ")
                       IF StartByte THEN
                         StartByte = StartByte + 26
                         LastByte =  INSTR(StartByte,UCASE$(temp),"</BODY>")
                         FUNCTION = MID$(temp,StartByte,LastByte-StartByte)
                       END IF
                    
                    END FUNCTION
                    
                    
                    '_________________________________________________________________
                    '
                    '   FUNCTION  Dot_IP
                    '_________________________________________________________________
                    
                    FUNCTION Dot_IP (hst AS STRING) AS STRING
                    
                         ' Given a Localhostname return its IP address
                         ' http://www.powerbasic.com/support/pbforums/showthread.php?t=7865
                         ' For info search for "getpeername"
                    
                         LOCAL IP AS LONG
                         DIM p AS BYTE PTR
                    
                         HOST ADDR hst TO ip&
                         p = VARPTR(ip&)
                         FUNCTION = USING$("#_.#_.#_.#", @p, @p[1], @p[2], @p[3])
                    
                    END FUNCTION
                    
                    '_________________________________________________________________
                    '
                    '   FUNCTION  MacAddressGet
                    '_________________________________________________________________
                    
                    FUNCTION MacAddressGet(MacAddress() AS STRING)AS LONG
                         LOCAL AdapterPointer    AS IP_ADAPTER_INF POINTER
                         LOCAL AdapterBufferSize AS DWORD
                         LOCAL AdapterBuffer     AS STRING
                         LOCAL MacAddressCount   AS LONG
                         LOCAL Looper            AS LONG
                         LOCAL Temp              AS STRING
                    
                         'The GetAdaptersInfo function can retrieve information only for IPv4 addresses, see GetAdaptersAddresses
                         IF GetAdaptersInfo(BYVAL 0, AdapterBufferSize) = %ERROR_BUFFER_OVERFLOW THEN
                              AdapterBuffer = NUL$(AdapterBufferSize)
                              AdapterPointer = STRPTR(AdapterBuffer)
                              IF GetAdaptersInfo(BYVAL AdapterPointer, AdapterBufferSize) = %ERROR_SUCCESS THEN
                                   DO 'For each network adaptor
                                        INCR MacAddressCount
                                        REDIM PRESERVE MacAddress(1 TO MacAddressCount)
                    '                    Temp = "Description: " + @AdapterPointer.Description '+ $CRLF + "AdapterName: " + @AdapterPointer.AdapterName
                                        Temp = @AdapterPointer.Description
                                        REPLACE CHR$(0) WITH "" IN Temp
                                        MacAddress(MacAddressCount) = Temp$ +$CR + "MAC: "
                                        FOR Looper = 0 TO @AdapterPointer.AddressLength - 1  'Build MAC address
                                             MacAddress(MacAddressCount) = _
                                             MacAddress(MacAddressCount) & HEX$(@AdapterPointer.Address(Looper), 2) & $SPC
                                        NEXT
                                        MacAddress(MacAddressCount) = MacAddress(MacAddressCount) + $CRLF
                                        AdapterPointer = @AdapterPointer.pNext
                                   LOOP WHILE AdapterPointer
                              END IF
                         END IF
                    
                         FUNCTION = MacAddressCount
                    
                    END FUNCTION
                    
                    
                    '_________________________________________________________________
                    '
                    '   FUNCTION  GetMACaddressName
                    '_________________________________________________________________
                    
                    FUNCTION GetMACaddressName(szIP AS STRING) AS STRING
                        ' MAC Addresse Names
                        '
                        '  Input: IP address from which you want the MAC address
                        ' Output: The MAC address as "00-00-00-00-00-00" on success
                        '         null string on failure. Bad IP addresses returns a
                        '         null string.
                        '
                        'Depends: win32API.inc, iphlpapi.inc, wsock32.inc
                        '
                        LOCAL Result        AS LONG
                        LOCAL MACbytes      AS LONG
                        DIM   ipArray(0)    AS DWORD
                        DIM   p             AS BYTE PTR
                    
                        '
                        FUNCTION = "" : IF LEN(TRIM$(szIP)) = 0 THEN EXIT FUNCTION
                        '
                        'The first six bytes of the array receive the physical address that corresponds to the IP
                        'address specified by szIP. See "SendARP" in MSDN for more info.
                        MACbytes = 6  'MACbytes is NOT a statement about Apple Macintosh's
                        '
                        Result = SendARP(inet_addr(BYVAL STRPTR(szIP)), 0, ipArray(0), MACbytes)
                        IF Result = %NO_ERROR THEN   'Success
                           p = VARPTR(ipArray(0))
                           FUNCTION = HEX$(@p, 2) & "-" & HEX$(@p[1], 2) & "-" & HEX$(@p[2], 2) & "-" & HEX$(@p[3], 2) & _
                                      "-" & HEX$(@p[4], 2) & "-" & HEX$(@p[5], 2)
                        END IF
                    END FUNCTION
                    
                    '_________________________________________________________________
                    '
                    '   FUNCTION  FindMACAddress
                    '_________________________________________________________________
                    
                    FUNCTION FindMACAddress AS STRING
                         '-----------------------------------------------------------------------------
                         ' IP, Network, Intenet & MAC Address
                         '-----------------------------------------------------------------------------
                         ' This routine Gets the IP and MAC Address of the cards
                         ' IF they ARE connected. Otherwise it only gives its description.
                    
                         DIM Local_HostName       AS GLOBAL STRING
                         DIM Local_IP             AS GLOBAL STRING   ' Primary IP - Connected Socket
                         DIM Client_IP            AS GLOBAL STRING   ' Public IP
                         DIM Client_IPAndServer   AS GLOBAL STRING   ' Public IP & ISP id name
                         DIM Local_Ip_MAC         AS GLOBAL STRING   ' MAC
                         DIM Local_Ip_Description AS GLOBAL STRING
                         DIM MacAddressCount      AS LOCAL LONG
                         DIM MacAddress(1 TO 1)   AS LOCAL STRING
                         LOCAL sNetwork   AS STRING
                         LOCAL i AS LONG
                         LOCAL lResult AS LONG
                    
                         ' Get values
                         GetNetworkAndWebParameters (Local_Hostname, Local_Ip, Client_IP, Client_IPAndServer)
                    
                         IF LEFT$(Local_IP$,2) = "No" THEN
                    
                              ' MAC Addresess (Get MAC Address Pierre)
                              ' This routine gets the MAC address of any/every card in the system
                              ' regardles of it being connected or not.
                              ' This function work even if no network connection is avaiable
                              MacAddressCount& = MacAddressGet(MacAddress$())
                              ' The results are in the MacAddress() array. MacAddressCount& has the total adapters found
                              IF MacAddressCount& > 0 THEN
                                   Local_IP_Description$ = PARSE$(MacAddress(1), $CR ,1)
                                   Local_IP_MAC$ = PARSE$(MacAddress(1), $CR ,2)
                              END IF
                         ELSE
                              Local_IP_MAC$ = GetMACaddressName(EXTRACT$ (Local_IP, "("))
                              'REPLACE "-" WITH " " IN Local_IP_MAC$
                    
                              ' Get only the MAC for the Local_IP
                              MacAddressCount = MacAddressGet(MacAddress())
                              FOR i = 1 TO MacAddressCount&                           ' This does
                                 lResult = INSTR(MacAddress(i), TRIM$(Local_IP_MAC$))
                                 IF lResult THEN EXIT FOR
                              NEXT
                    
                              IF lResult THEN
                                   Local_Ip_Description$ = PARSE$(MacAddress(i),$CR,1)
                              ELSE
                                   Local_Ip_Description$ = "0"
                              END IF
                    
                         END IF
                    
                    
                         ' IP, Network and Internet data:
                         IF MacAddressCount THEN
                              sNetwork$ = Local_IP_MAC
                         ELSE
                              sNetwork$ = "No network adapters were found."
                         END IF
                         '? sNetwork$
                         FUNCTION = sNetwork$
                    END FUNCTION

                    Comment


                    • #11
                      If your IP is this "127.0.0.1" then you are not connected.
                      If the network card is not detected then you are not connected.
                      In the example above:
                      If you cannot reach checkip.dyndns.com then you are likely not connected, your firewall may be blocking your attempts, or the DNS site is down. Likewise for any other site you may be attempting to reach.
                      Last edited by Jim Fritts; 20 Oct 2017, 02:22 PM.

                      Comment


                      • #12
                        Thanxx Jim

                        However I still got the same MAC address despite unplucking the CAT5 cables from my pc as well as from the switch.
                        Thus there is no internet connection at all

                        Not able to get IP = "127.0.0.1"





                        Comment


                        • #13
                          If the PC has a network interface it will have MAC, whether it is connected to a network or not. It will never change. If the PC has a CAT-5 interface and a wireless interface it will have two MACs. My laptop also has a Tunnel Adaptor that has a MAC.

                          In Command Prompt (cmd.exe) run
                          ipconfig /all
                          The item(s) labeled "Physical Address" in the response is the MAC for each adaptor

                          ((called to dinner in the middle. so now I may be repeating someone else, will continue anyway.))

                          127.0.0.1 is the loop-back IP address. Every device (that I've ever heard of) that has IP driver software/firmware installed has this address in it. A device cannot network to another device with this IP. No network connection needed for this address to exist. It is for a device to "talk to itself".

                          Though rare these days, if your LAN uses fixed IP numbers, then existance of an IP on the PC does not indicate a network connection; it is always there.

                          With DHCP a valid ((on your LAN)) IP number on the PC means there is a LAN connection, but only maybe an internet connection.

                          In addition to other suggestions, a "ping" to your ISPs DNS or DHCP server (not your local DHCP server) is a test for Internat connection.

                          Cheers,
                          Dale

                          Comment


                          • #14
                            Yes, after I posted I had to leave as well and I left thinking hmm maybe he has a fixed IP. That would surely throw a monkey wrench into it. FindMACAddress did find your MAC even when the cable was disconnected. So the question is which MAC address it is. Is it the one for laptop WAN? Is it the one for laptop LAN? Does the device have a fixed IP address? Just because you disconnected the LAN cable doesn't change the connection with WAN.

                            Another easy test if your IP address is not one that is fixed. Leave your cable connected then power off the router/switch. Run FindMACAddress. Powering off the router/switch will kill both WAN and LAN connections; assuming you're not piggy backing on your next door neighbor's WiFi.

                            Sorry Chris, Windows plays by it's own rules. Windows does take a while to recognize the internet connection is lost. Once it establishes a connection it generally assumes the connection will be valid for a period of time and will eventually retest the connection.


                            Chris, Chris, Chris

                            Try commenting these lines:

                            Code:
                                      ' MAC Addresess (Get MAC Address Pierre)
                                      ' This routine gets the MAC address of any/every card in the system
                                      ' regardles of it being connected or not.
                                      ' This function works even if no network connection is avaiable
                                '      MacAddressCount& = MacAddressGet(MacAddress$())
                                      ' The results are in the MacAddress() array. MacAddressCount& has the total adapters found
                                '      IF MacAddressCount& > 0 THEN
                                '           Local_IP_Description$ = PARSE$(MacAddress(1), $CR ,1)
                                '           Local_IP_MAC$ = PARSE$(MacAddress(1), $CR ,2)
                                '      END IF
                            and see what you get. The app was designed to pick the 1st MAC address if an internet connection couldn't be made.
                            Last edited by Jim Fritts; 20 Oct 2017, 09:30 PM.

                            Comment


                            • #15
                              I would think a good test would be to open port 80 at some known website and see if you can do a small GET.
                              That will test the "Internet" vs a network connection.

                              Another thought... Let's say you have a connection to a TCP IP end point. You unplug the endpoint from the switch - will your computer know that happened? No - that is precisely one of the points of TCP IP - The only real way to get a proper error is to keep sending data to the connection. At some point the TCP IP stack will decide that retrying is not going to work and will give you an error.

                              TCP IP is not like serial over RS232 - There is no solid DTR or CTS on a wire. Get Wireshark and check it out.

                              I have a small "heartbeat" thing I send to my endpoints - Yes I did write the endpoints so I have control over both sides.

                              Remember - TCP IP it trying to help you by re-trying a few times before it gives up and errors back.


                              Comment


                              • #16
                                You could even run this in a thread called from a timer to keep checking.


                                Code:
                                #COMPILE EXE
                                #DIM ALL
                                
                                FUNCTION PBMAIN () AS LONG
                                
                                   LOCAL RECEIVE_BUFFER AS STRING
                                
                                   TRY
                                    TCP OPEN PORT 80 AT "google.com" AS #1
                                   CATCH
                                    MSGBOX "IF THIS FAILS THEN NO INTERNET"
                                   END TRY
                                
                                   TCP PRINT #1, "HEAD"
                                   TCP PRINT #1, ""
                                
                                   TCP RECV #1, 4, RECEIVE_BUFFER
                                   IF RECEIVE_BUFFER = "HTTP" THEN
                                       MSGBOX "YOU HAVE INTERNET"
                                     ELSE
                                       MSGBOX "NO INTERNET"
                                   END IF
                                
                                
                                END FUNCTION

                                Comment


                                • #17
                                  Thanxx Jim

                                  As you have suggested, I modified the code as below and it works now

                                  Code:
                                   IF LEFT$(Local_IP$,2) = "No" THEN
                                  
                                   ?  " No internet "
                                            ' MAC Addresess (Get MAC Address Pierre)
                                            ' This routine gets the MAC address of any/every card in the system
                                            ' regardles of it being connected or not.
                                            ' This function work even if no network connection is avaiable
                                      '      MacAddressCount& = MacAddressGet(MacAddress$())
                                            ' The results are in the MacAddress() array. MacAddressCount& has the total adapters found
                                       '     IF MacAddressCount& > 0 THEN
                                                ' pick the 1st MAC address
                                           '      Local_IP_Description$ = PARSE$(MacAddress(1), $CR ,1)
                                           '      Local_IP_MAC$ = PARSE$(MacAddress(1), $CR ,2)
                                          '  END IF
                                       ELSE
                                            Local_IP_MAC$ = GetMACaddressName(EXTRACT$ (Local_IP, "("))
                                            'REPLACE "-" WITH " " IN Local_IP_MAC$
                                  
                                            ' Get only the MAC for the Local_IP
                                            MacAddressCount = MacAddressGet(MacAddress())
                                            FOR i = 1 TO MacAddressCount&                           ' This does
                                               lResult = INSTR(MacAddress(i), TRIM$(Local_IP_MAC$))
                                               IF lResult THEN EXIT FOR
                                            NEXT
                                  
                                            IF lResult THEN
                                                 Local_Ip_Description$ = PARSE$(MacAddress(i),$CR,1)
                                            ELSE
                                                 Local_Ip_Description$ = "0"
                                            END IF
                                  
                                       END IF

                                  Comment


                                  • #18
                                    Like I said earlier...
                                    To get a more immediate and accurate result wouldn't you need to try to access a website first. That way the connection status gets updated based on that simple test. I assume that function merely reports the current status based on the prior attempts to access the LAN or WAN.
                                    I like David's idea. Very clean

                                    Well, I tried David's code but it does not yield any results and it does not self terminate. I'm thinking Port 80 on my machine may be blocked.
                                    Last edited by Jim Fritts; 21 Oct 2017, 10:03 AM.

                                    Comment


                                    • #19
                                      Does the below code pings the website ?
                                      as some websites drop ping to prevent attacks. So it may not work on all websites?

                                      But it is a very fast check which is good

                                      TCP OPEN PORT 80 AT "google.com" AS #1
                                      Last edited by Chris Chancellor; 21 Oct 2017, 09:53 AM.

                                      Comment


                                      • #20
                                        No. Just opens a TCP as #1, does not send or receive anything.

                                        Cheers,
                                        Dale

                                        Comment

                                        Working...
                                        X