in reply to Detecting dial-up connections

Here's a little more information:

Goto here and search for Q242558 in the search box. This is an article using 'C' to determine if you're connected to the net or not. Good foundation information here.

Win32::Internet.pm (click on search CPAN when you get to the window) is basically an interface into the above, but seems to lack the 'InternetGetConnectedState' call. I haven't written any API interface modules, but as much as this module does, it should be easy to hack it in (and it you do, make sure to propagate the changes back to the author. Can't imagine why he left it out).

This module Win32::RASE (click on search CPAN when you get to the window) isn't what you're looking for, but is pretty cool for managing your connection lists. It might have some other applicability for you in the future (Or not, if you switch to Linux!)

Hope that helps a little.

--Chris
  • Comment on (jcwren) RE: Detecting dial-up connections

Replies are listed 'Best First'.
RE: RE: Detecting dial-up connections
by Corion (Patriarch) on Jun 10, 2000 at 14:12 UTC

    Win32::RASE makes checking the internet connection status possible, if one digs a bit deeper. I've thought about doing a "real" program for this, but now I see that Perl already has the necessary bindings for connection checking :).

    To use Win32::RASE to check the internet connection, I'd do something like the (untested) following :

    use strict; use Win32::RASE; my (%connections, $entry, $hrasconn); %connections = RasEnumConnections(); foreach $entry (keys %connections) { my $status; $hrasconn = $connections{$entry}; $status = RasGetConnectStatus( $hrasconn ); if ($status == RASCS_DeviceConnected) { print "Computer is online via $entry\n"; }; };