Most of the stuff on this resource page was when we used to use modems to access the Internet, but there are some items (near the bottom of the page) you might find useful:
http://brenemanlabs.com/iConnect.htm
I can show you how to detect if google is online:I guess one website isn't enough, what if the google website is down or under attack or has got problems ...?
http://ip.thaddy.com (online 99.8% since 1998) This is a text string, not html...Beautiful IP ... I love it :P
Most of us are trying to kill off Windows XP before the end of the month though.HERETIC :P
Just in case there is some magician out there who can do it without establishing an internet connection, then PLEASE provide a link! :DHere is a way that doesn't require YOU to establish an internet connection but, that doesn't mean the system didn't establish one for you.
The code is in C but, it's quite simple. Porting it to Pascal should take very little time.
PS: I haven't tried his method but, it looks reasonable and, seems to be along the lines of what you're asking for.Well... I have tried it some ions ago that's why I have this service. (Actually two, one is more advanced and detects redirects, see much older postings for context).
In my case I give you your ip for free.... 8-)You're really funny. Every internet connection you make has your ip. So nice of you to give one's IP for free... a real Santa Ip you are. :)
No... external IP, and not even my direct IP. You are being silly. (or have not sufficient understanding how routing works)In my case I give you your ip for free.... 8-)You're really funny. Every internet connection you make has your ip. So nice of you to give one's IP for free... a real Santa Ip you are. :)
No... external IP, and not even my direct IP. You are being silly. (or have not sufficient understanding how routing works)Your posts indicate that your job most likely consists in arguing about things you know nothing, it is likely due to your extensive experience in that area that it might very well be the only thing you do well.
Look up my original postings. Both links are still up after all those years. Also demonstrates the difference. :-X :-X.... Plz take note... You deserve my mild insults...
And YES testing an internet connection can only be done through a full connection. Happens to be my job.. just in case...Anything else can be spoofed from a local network.
(Hence that site is fully static and doesn't need https)
No it is not equal, in my opinion.That is why I posted the question, I want to hear members' opinions.
I think, if the machine have an misconfigured dns then you only know that only ip is working.I see what you mean. What I propose does not rely on the configuration of the machine. The procedure will send a DNS query packet to a DNS server, 8.8.8.8 for instance, and wait for a valid reply.
With test against dns you can be sure that both works.
Do you enter an IP address in the address field of the browser?Sometimes I do!
Here is a way that doesn't require YOU to establish an internet connection but, that doesn't mean the system didn't establish one for you.
This is fantastic. Thank you for pointing this one out.I'm very pleased you liked it.
This is fantastic. Thank you for pointing this one out.This feature only means that your gateway is alive. If it has nothing to do with the Internet, then the result of the function too.
This doesn't work on a Mac... to bad :'(Here is a way that doesn't require YOU to establish an internet connection but, that doesn't mean the system didn't establish one for you.
This is fantastic. Thank you for pointing this one out.
unit useRoutingTable; {$mode objfpc}{$H+} interface { Pointed out by @440bx: https://forum.lazarus.freepascal.org/index.php/topic,23943.msg321556.html#msg321556 } function IsInternetAvailable(): boolean; implementation uses Windows; //constant and types from JwaIpHlpApi and JwaIpRtrMib const ANY_SIZE = 1; type {$PUSH} {$PACKENUM 4} // jediapilib.inc MIB_IPFORWARDROW = record dwForwardDest: DWORD; dwForwardMask: DWORD; dwForwardPolicy: DWORD; dwForwardNextHop: DWORD; dwForwardIfIndex: DWORD; dwForwardType: DWORD; dwForwardProto: DWORD; dwForwardAge: DWORD; dwForwardNextHopAS: DWORD; dwForwardMetric1: DWORD; dwForwardMetric2: DWORD; dwForwardMetric3: DWORD; dwForwardMetric4: DWORD; dwForwardMetric5: DWORD; end; //PMIB_IPFORWARDROW = ^MIB_IPFORWARDROW; MIB_IPFORWARDTABLE = record dwNumEntries: DWORD; table: array [0..ANY_SIZE - 1] of MIB_IPFORWARDROW; end; PMIB_IPFORWARDTABLE = ^MIB_IPFORWARDTABLE; {$POP} function GetIpForwardTable(pIpForwardTable: PMIB_IPFORWARDTABLE; var pdwSize: ULONG; bOrder: BOOL): DWORD; stdcall; external 'iphlpapi.dll'; function IsInternetAvailable(): boolean; var bIsInternetAvailable: boolean = false; dwBufferSize: DWORD = 0; dwIndex: DWORD; pRoutingTable: PMIB_IPFORWARDTABLE; pByte: Windows.PBYTE; dwRowCount: DWORD; begin // Get the required buffer size if (ERROR_INSUFFICIENT_BUFFER = GetIpForwardTable(nil, &dwBufferSize, false)) then begin pByte := GetMem(dwBufferSize); if (pByte<>nil) then begin pRoutingTable := PMIB_IPFORWARDTABLE(pByte); // Attempt to fill buffer with routing table information if (NO_ERROR = GetIpForwardTable(pRoutingTable, dwBufferSize, false)) then begin dwRowCount := pRoutingTable^.dwNumEntries; // Get row count // Look for default route to gateway for dwIndex := 0 to dwRowCount-1 do begin if (pRoutingTable^.table[dwIndex].dwForwardDest = 0) then begin // Default route designated by 0.0.0.0 in table bIsInternetAvailable := true; // Found it break; // Short circuit loop end; end; end; FreeMem(pByte); // Clean up. Just say "No" to memory leaks end; end; Result := bIsInternetAvailable; end; end.
Did you use "If"?This is fantastic. Thank you for pointing this one out.This feature only means that your gateway is alive. If it has nothing to do with the Internet, then the result of the function too.
This doesn't work on a Mac... to bad :'(There must be a similar code for Mac and Linux. Look for retrieving the routing table.
This doesn't work on a Mac... to bad :'(The WINDOWS API isn't working on a MAC?
Can you give one example where this entry could exist without internet connection?I. e. you apparently consider that the network without the Internet does not exist?
The network with the router has a separate entry. If you control the settings of your router using 192.168.44.1, for instance, you'll have an entry in the routing table with network destination value of 192.168.44.0.Can you give one example where this entry could exist without internet connection?I. e. you apparently consider that the network without the Internet does not exist?
In most cases this can give a good result if someone connects to the internet with a router that is always connected and has no security software running. But in my case I simply opened a program that has no right to connect and then FIREFOX cannot reach a website anymore. As long as the program is in the background.
And here you can read how about Windows do that:
https://blog.superuser.com/2011/05/16/windows-7-network-awareness/
It does not tell you if the server you are trying to reach is down.Correct, the server is fine... at least right now ... :)
Blocking access to the server does not mean you do not have access to the internet.QuoteIt does not tell you if the server you are trying to reach is down.Correct, the server is fine... at least right now ... :)
Blocking access to the server does not mean you do not have access to the internet.
QuoteBlocking access to the server does not mean you do not have access to the internet.
The security software doesn't allow anybody (in this case FIREFOX) to connect to the internet. As long as the forbidden program is running. Internet access (hardware) is definitely possible, but for the normal user it doesn't make a difference. The reason is not visible to the user. I don't know if this is the same with the onboard Windows-Firewall, I never use the windows firewall. I think it's not trustworthy enough... :)
The security software doesn't allow anybody (in this case FIREFOX) to connect to the internet.I thought things that did that were called malware.... :D
I thought things that did that were called malware.... :DDefinitely ... In this case malware that I really like to use !!! :)
QuoteThis doesn't work on a Mac... to bad :'(The WINDOWS API isn't working on a MAC?
Sue Apple !!! :D
When your system discovers that your computer can reach 8.8.8.8 through your router on 192.168.44.1, it adds the 0.0.0.0 entry for you. It will delete this entry when it fails, or when 192.168.44.1 disconnects (hardware) or disappears (Software: ARP packets receive no response).Complete nonsense. Check in any LAN with the switch or the router. There are stations on the L3 switch or the router will have 0.0.0.0 as the default gateway. So again, all this function checks is that there is a default gateway and it is alive. With the Internet it is connected only if this gateway goes to the Internet, but this check is certainly not here. At home, this is usually the case, but as I said, a couple of stations and one router to the Internet provider - this is not the only possible network configuration.
Complete nonsense. Check in any LAN with the switch or the router. There are stations on the L3 switch or the router will have 0.0.0.0 as the default gateway. So again, all this function checks is that there is a default gateway and it is alive. With the Internet it is connected only if this gateway goes to the Internet, but this check is certainly not here. At home, this is usually the case, but as I said, a couple of stations and one router to the Internet provider - this is not the only possible network configuration.You are right. If the computer is part of a WAN you will have that entry in your forwarding table.