首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

如何判断无线网络是否连接正常

2012-01-05 
怎么判断无线网络是否连接正常winCE 怎么判断无线网络是否连接正常?我要判断无线网络是否连接正常,连接正

怎么判断无线网络是否连接正常
winCE 怎么判断无线网络是否连接正常?
我要判断无线网络是否连接正常,连接正常显示正常图片,不正常显示断线图标。
怎么判断?API C#做。

[解决办法]

C# code
 //判断网络连接        [DllImport("wininet")]        private extern static bool InternetGetConnectedState(out int connectionDescription, int reservedValue);        ///<summary>        /// 检测本机的网络连接        ///</summary>        private void button1_Click(object sender, EventArgs e)        {            //判断是否联网                int i = 0;                if (InternetGetConnectedState(out i, 0))                {                    //联网                    MessageBox.Show("Thylx提醒您:你的计算机已连接到网络上!");                 }                 else                  {                     //断网                     MessageBox.Show("Thylx提醒您:本地连接已断开!");                  }        } 

热点排行