使用OpenNetCF完成windows mobile上的wifi通信
2010-08-23 05:25:00 来源:WEB开发网安装后找找dll就行了。这4个dll其实在编码中只会用到OpenNetCF.NET中的NetworkInformation命名空间
2 先讲讲怎么打开wifi吧,网络上流传着好多打开wifi的通用代码,我也copy了一份,
view sourceprint?001static private string keyValue = null;
002
003public enum CEDEVICE_POWER_STATE
004
005{
006
007PwrDeviceUnspecified = -1,
008
009/* D0 = 0,
010
011D1,
012
013D2,
014
015D3,
016
017D4,
018
019*/ FullOn = 0,
020
021LowPower = 1,
022
023Standby = 2,
024
025Sleep = 3,
026
027Off = 4,
028
029PwrDeviceMaximum
030
031}
032
033[DllImport("coredll.dll")]
034
035public static extern int DevicePowerNotify(string device, CEDEVICE_POWER_STATE state, int flags);
036
037[DllImport("coredll.dll")]
038
039public static extern int SetDevicePower(string pvDevice, int df, CEDEVICE_POWER_STATE ds);
040
041[DllImport("coredll.dll")]
042
043unsafe public static extern int GetDevicePower(string pvDevice, int df, CEDEVICE_POWER_STATE* pds);
044
045static private void setKeyValue()
046
047{
048
049string wifiGUID = "{98C5250D-C29A-4985-AE5F-AFE5367E5006}";
050
更多精彩
赞助商链接