Solved

How to know if I 'm connected ?

Posted on 1998-12-21
7
213 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
ID: 1352359
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
ID: 1352360
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
ID: 1352361
I shearch an api to know if I' m connected to internet...
The dwwang's answer seems good .
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 3

Expert Comment

by:williams2
ID: 1352362
ok, Wang, let's see what you've got

Regards,
Williams
0
 
LVL 7

Expert Comment

by:jconde
ID: 1352363
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
ID: 1352364
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
ID: 1352365
>>"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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 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