Solved

Detecting when the internet is connected

Posted on 2001-06-06
5
145 Views
Last Modified: 2010-05-02
I want to build a program that can detect the connection and the deconnection of the internet.
The computer where the prog will be running is connected to a local network who has a modem to connect to the internet.
Resuming i want to know when the internet is active in thst computer, i say the internet because i want to monitor severall services.
Another point os that the net on the server might be running to other pcs but i want to know if that one is running internet or not.

50 bonus points for quick answer
0
Comment
Question by:ElvasLion
  • 3
5 Comments
 
LVL 6

Expert Comment

by:JonFish85
ID: 6160309
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6160433
Hi!

Here's a link for you:

Download...
http://www.vb-helper.com/Howto/chkmodem.zip
Description: See if the modem is connected (5K)

Actually, the best method would be to ping a website and see if there's a response o not.  That would detrmine whether there is a connection or not.

That's it!

glass cookie : )
0
 
LVL 8

Accepted Solution

by:
glass_cookie earned 200 total points
ID: 6160450
Hi!

Here's a better code than the one I posted ppreviously.

Download...
http://www.freevbcode.com/code/IsConnect3.zip

Description: This nice demo application demonstrates 3 ways to detect whether or not a current Internet connection is active -- by checking the registry, by using functions within the wininet.dll, and by pinging yahoo.com. Remarks explaning the advantages and disadvantages of each method are included within the application.

Do note that this one includes the pinging part.  So, here's the code for it : )

That's it!

glass cookie : )
0
 
LVL 1

Author Comment

by:ElvasLion
ID: 6178098
sorry for the delay but i could'nt reply before. Your answer was excellent and i'm going to give you your bonus points.
Thanks
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6179862
Thanks a lot too : )
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

867 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

15 Experts available now in Live!

Get 1:1 Help Now