Solved

Detecting when the internet is connected

Posted on 2001-06-06
5
149 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

820 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