Link to home
Start Free TrialLog in
Avatar of seb24
seb24

asked on

How to know if I 'm connected ?

I want to write an application like the microsoft tray icon...
Avatar of williams2
williams2

Would you please be more specific? To know if you're connected to the internet needs RAS handling, which I can help you with, but to make a TrayIcon application is another matter but simple to do.

Regards,
Williams
I think seb24 want to find whether the computer is connected via RAS, and then make a tray icon(if is connected).

So you can download the rascomp from http://www.magsys.co.uk/delphi/, in the example programm you can find all.

For making tray icons, there are so many components at DSP/Torry's/...

Regrads,
Wang
Avatar of seb24

ASKER

I shearch an api to know if I' m connected to internet...
The dwwang's answer seems good .
ok, Wang, let's see what you've got

Regards,
Williams
If you mean if there's an internet connection available, you can't really know.

You can detect if there's a ras connection available, as well as an IP, but you can't know if you're connected to the Internet.

It's easier modem wise, but what happens if you're part of an Intranet?....you won't be able to know if you're connected unless you ping some out side server.  On the other hand, what would happen if you're behind a firewall?...
You can do it by pinging a server, and there's no problems regarding to firewalls. The only problem is, that a connector from the outside will not be able to page you, but that is not the point. I can handle this without any problems at all.

If I was to do it, I would first test if there was a connection to an outside server. If that was not the case, I would go to some sort of sleep mode, where I would test the server if
1) I detected a RAS connection
2) Some time has passed by let's say 30 seconds.

Regards,
Williams
ASKER CERTIFIED SOLUTION
Avatar of dwwang
dwwang

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