如何在C#Windows 7中从Wlan的空闲状态获取信息 [英] How to get information from the idle state of wlan in C# windows 7

查看:94
本文介绍了如何在C#Windows 7中从Wlan的空闲状态获取信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

In my project I need to detect the idle state of wlan in windows 7, but failed because the class I use System.Net.NetworkInformation Namespace. NET.

该类指定网络接口的操作状态:"休眠,向下,LowerLayerDown,notPresent ,测试,未知,向上"

The class specifies the operational state of the network interface: "Dormant, Down, LowerLayerDown, notPresent, Testing, Unknown, Up"

链接:http://msdn.microsoft.com/en-us/library/system.net.networkinformation.operationalstatus.aspx

Link: http://msdn.microsoft.com/en-us/library/system.net.networkinformation.operationalstatus.aspx

这些状态似乎都不与wlan的空闲状态相对应.

None of these states seem to correspond to the idle state of wlan.

研究了能量状态如何信息却只发现了. Net紧凑框架位于:枚举_CEDEVICE_POWER_STATE.链接:" msdn.microsoft.com/pt-br/library/aa932261.aspx

Researched how information of energy states but only found the. Net compact framework in: enum _CEDEVICE_POWER_STATE. Link: "msdn.microsoft.com/pt-br/library/aa932261.aspx

我试图对"Win32_NetworkAdapter"进行WMI查询;链接:"http://msdn.microsoft.com/en-us/library/windows/desktop/aa394216(v=vs.85).aspx"字段"uint16可用性";对于平均值= 14 =省电-低功率模式",则为"0". 或值含义= 15 =省电-待机".但查询仅返回"value = 3 =含义运行或满功率".

I tried to do a WMI query on "Win32_NetworkAdapter" link: "http://msdn.microsoft.com/en-us/library/windows/desktop/aa394216(v=vs.85).aspx" field "uint16 Availability" for "Meaning Value = 14 = Power Save - Low Power Mode" or "Value Meaning = 15 = Power Save - Standby" but the query only returns "value = 3 = Meaning Running or Full Power" even the network adapter off.

推荐答案

马里奥,

欢迎来到MSDN论坛.

Welcome to the MSDN Forum.

不推荐使用Win32_NetworkAdapter.请尝试以下API: http://msdn. microsoft.com/en-us/library/windows/desktop/hh968170(v=vs.85).aspx  

The Win32_NetworkAdapter is deprecated. Please try this API: http://msdn.microsoft.com/en-us/library/windows/desktop/hh968170(v=vs.85).aspx 

最好的问候


这篇关于如何在C#Windows 7中从Wlan的空闲状态获取信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆