问题描述:

how to 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

相关阅读:
Top