Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Detecting when the internet is connected

Posted on 2001-06-06
5
Medium Priority
?
157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 800 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Suggested Courses

721 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