开发者

network availabitily in windows ce

how to开发者_StackOverflow中文版 develop small app to windows ce ,to know network availability in device using c#


( i am copying my answer to a similar question here )

Look in the registry key HKLM\system\state\connections, there is are entries for each of the possible network types, for instance:

When connected to a wireless network:

[HKLM\system\state\Connections\Network]
Adapters="BCMSDDHD1"
Count=dword:00000001
Descriptions="Business World"

when connected to activesync:

[HKLM\system\state\Connections\Desktop]
Adapters=""
Count=dword:00000001
Descriptions="CurrentDTPTNetwork"

The Count value under HKLM\system\state\connections gives you the total number of active connections.

In HKLM\system\state\Hardware you can find the current power state of the various devices.


Use HttpWebRequest, and try connecting to Google:

http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(v=VS.80).aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜