using System ;
using
System.Runtime ;
using System.Runtime.InteropServices ;

public class InternetCS
{

//Creating the extern function...
[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://blog.csdn.net/rcom10002/archive/2005/01/11/249267.aspx

相关文章:

  • 2021-10-15
  • 2021-06-08
  • 2021-06-23
  • 2022-02-11
  • 2021-11-01
  • 2022-12-23
  • 2022-02-01
  • 2021-07-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
  • 2021-07-20
  • 2021-07-16
  • 2022-12-23
相关资源
相似解决方案