Solved

How to know if I 'm connected ?

Posted on 1998-12-21
7
208 Views
Last Modified: 2010-04-04
I want to write an application like the microsoft tray icon...
0
Comment
Question by:seb24
7 Comments
 
LVL 3

Expert Comment

by:williams2
Comment Utility
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
0
 
LVL 4

Expert Comment

by:dwwang
Comment Utility
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
0
 

Author Comment

by:seb24
Comment Utility
I shearch an api to know if I' m connected to internet...
The dwwang's answer seems good .
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 3

Expert Comment

by:williams2
Comment Utility
ok, Wang, let's see what you've got

Regards,
Williams
0
 
LVL 7

Expert Comment

by:jconde
Comment Utility
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?...
0
 
LVL 3

Expert Comment

by:williams2
Comment Utility
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
0
 
LVL 4

Accepted Solution

by:
dwwang earned 50 total points
Comment Utility
>>"The dwwang's answer seems good"

Ok, so you mean you want to accept my answer? :-)

Well, the RAS component propsed above enumerates RAS connections avalable in the system, and judge wich one is active, just that.

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now