public class Net
{
[DllImport("wininet")]
private extern static bool InternetGetConnectedState(out int connectionDescription, int reservedValue);

/// <summary>
/// 检测本机是否联网
/// </summary>
/// <returns></returns>
public static bool IsConnectedInternet()
{
int i = 0;
if (InternetGetConnectedState(out i, 0))
{
//已联网
return true;
}
else
{
//未联网
return false;
}

}

}

最新文章

  1. NOIP2004火星人
  2. 推公式 HDU 2552
  3. windows shell api SHEmptyRecycleBin 清空回收站
  4. Entity Framework7 有哪些不同?现在开发到什么程度了?
  5. ajax 调用 JSON.parse();
  6. MySQL日期时间函数大全(转)
  7. 贴代码—CF230 DIV1 B
  8. 编译器失败,错误代码为xxx
  9. Android开发UI之ViewPager及PagerAdapter
  10. tomcat环境变量配置
  11. C语言零移位操作
  12. 关于我们-EIBOA易博男装-互联网品质男装品牌-在线销售男士西服,衬衫,外套,西裤,领带|全场免运费,30天退换货保障
  13. iOS开发 使用Xcode自带的Leaks
  14. C/C++ 语言中的表达式求值(原文作者:裘宗燕)
  15. Vue 进阶之路(二)
  16. libavcodev may be vulnerable or is not supported, and should be updated for play video
  17. Nginx禁止IP直接访问网站
  18. Java实现inputstream流的复制
  19. Django+nginx+uwsgi部署教程
  20. JavaBasic_正则表达式

热门文章

  1. web自动化测试---xpath方式定位页面元素
  2. 关于iscroll插件的使用
  3. 【随笔】nginx add_header指令的使用
  4. kubernetes1.13之后的kubeadm init config
  5. KM算法及其应用
  6. [POJ 2689] Prime Distance
  7. [转]使用docker-compose 大杀器来部署服务 上
  8. C# 常用的加密代码参考
  9. mysql查看执行sql语句的记录日志
  10. Matlab arenstorf problem