in reply to (jcwren) RE: Detecting dial-up connections
in thread Detecting dial-up connections
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"; }; };
|
|---|