首页 > 其他 > 详细

WPF 检测计算机网络连接情况

时间:2014-07-09 00:08:14      阅读:622      评论:0      收藏:0      [点我收藏+]
 1   public static class NetWork
 2     {
 3         [DllImport("wininet.dll")]
 4         private extern static bool InternetGetConnectedState(out int connectionDescription, int reservedValue);
 5 
 6         public static bool IsOnLine()
 7         {
 8             try
 9             {
10                 var connection = 0;
11                 return InternetGetConnectedState(out connection, 0);
12             }
13             catch (Exception)
14             {
15              throw;
16             }
17         }
18     }

 

 

WPF 检测计算机网络连接情况,布布扣,bubuko.com

WPF 检测计算机网络连接情况

原文:http://www.cnblogs.com/gaobing/p/3830272.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!