[DllImport("wininet.dll")] private extern static bool InternetGetConnectedState( int out Description, int ReservedValue ) ;//Creating a function that uses the API function... public static bool IsConnectedToInternet( ) { int Desc ; return InternetGetConnectedState( out Desc, 0 ) ; }http://www.cnblogs.com/VvxT/archive/2011/01/01/1923609.html
System.Diagnostics.Process.Start("explorer.exe", "::{7007acc7-3202-11d1-aad2-00805fc1270e}");
System.Diagnostics.Process.Start("rundll32.exe", "shell32.dll,Control_RunDLL ncpa.cpl");
两句都可以
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState( int out Description, int ReservedValue ) ;//Creating a function that uses the API function...
public static bool IsConnectedToInternet( )
{
int Desc ;
return InternetGetConnectedState( out Desc, 0 ) ;
}http://www.cnblogs.com/VvxT/archive/2011/01/01/1923609.html