2 problems

This is a discussion on 2 problems within the C++ Programming forums, part of the General Programming Boards category; i'm not asking for the programs, just where to find specific information.
Heres a little info first, the program will ...

2 problems

i'm not asking for the programs, just where to find specific information.

Heres a little info first, the program will run on a server. The network has 50+ pc's and internet access is through 2 isdn lines through a router.

1. How can i programmatically check for an internet connection.
does pinging 127.0.0.1 tell me this and how to incorporate that in a program.

2. if a net connection is not present, i need to telnet into the router and control the maintenance program via a program, then forcing the lines to recconect (if i can control the maintenace program this is simply an option), the maintenance program is console based and uses menus (accessed via corresponding numbers). Totally not sure how to do this.

Surely this has been done before to automate control of the internet connection.

Where can i find information on this.

Thanks
(I know i asked similar questions before but i have included far more detail this time round.)

What i want though is to be able to do this via a program, i don't want to do anything manually, how can i write a program that can ping a server and then report to itself whether or not it has been successful.

I'm sure there are programs out there that check for a net connection in a better way than to ping microsoft.