Link to home
Start Free TrialLog in
Avatar of rfwoolf
rfwoolfFlag for South Africa

asked on

Check whether a PC has internet access

Any advice on how I'd check if the local system has internet access?

This needs to be compatible with 'standard' Windows operating systems, e.g. 32-bit, Win 95, 98, ME, XP, Vista, 7.

Thanks in advance.
Avatar of Geert G
Geert G
Flag of Belgium image

win95 ?
uh oh ... get out of there !
btw, you missed win3.1

you could use a webbrowser and open google.com
and then check if the document loads

off course there is the possibility your app gets blocked by the firewall
SOLUTION
Avatar of Pierre Cornelius
Pierre Cornelius
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rfwoolf

ASKER

Thanks guys..
I saw in another PAQ:
https://www.experts-exchange.com/questions/21915452/Check-for-ANY-KIND-of-internet-connection-ANY-INTERNET-CONNECTION.html
...the solution by HillGroover: a way to ping an address and it returns a boolean result.
This seems to be in line with what I'm looking for, but it's not easy to go and test it on multiple operating systems and with PCs with dialup etc..

Let me know if you have any ideas to top that solution, or if you foresee any problems.

'if you know the resource you will be accessing try that one instead.'
Not sure on what you mean by resource.
You could use Indy components to do that

TIDIPWatch :
Determines the online status and IP addresses for a computer.

* property IsOnline: Boolean;
Description
IsOnline is a read-only Boolean property used to identify the current online status. IsOnline is updated in the CheckStatus method, and is set to True when the current IP address is not empty ('') or the default local host value 127.0.0.1.

That will tell you if you are connected to your DHCP or have a fixed IP address working, but maybe that will not be enough for you, and you will want to know if you can actually access Internet. That is a start, then you should try other components :

TIdEcho (Ping) with www.google.com is probably the quickest way to check "internet" availability
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
rfwoolf;
CodedK has the best answer.
But how long would you closed all your open post?
I have seen several question answered from delphi experts.
I'm sorry if I offended you,  but,  that is not good,  throwing some points to the experts who participated in your post is one great help.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes of course ! InternetCheckConnection ! I forgot about that one...

Thanks Hypo ! And it's good to hear from you again !
Welcome back Hypo;
I'm glad to hear you.

Before I post my first comment,  I'm thinking to post "InternetCheckConnection" but probably ping is the best and quickiest way to find out, because you can customized the byte to send, you can send 1 byte n reply.
Thanks :) It's good to be back again... I've been way too busy with other projects for quite some time now, but I'll try to look in here more often :D

/Hypo