码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2014-07-09 00:08:30      阅读:246      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   color   cti   io   

 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 检测计算机网络连接情况

标签:des   style   blog   color   cti   io   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!