如何捕获插入终端到底座并进行此测试?
我需要检查3件事:
1. if the terminal is in the cradle
2. if i got IP
3. if there is connection to my WebService在此之后,我需要在我的WebService之间传输数据到终端(Windows-Mobile6.5)
我该怎么做呢?
发布于 2011-10-18 05:06:18
有一个命名空间Microsoft.WindowsMobile.Status
在那里你可以找到关于你的设备的相关信息。
例如,我使用下面的代码片段来了解是否存在活动的桌面连接。
Microsoft.WindowsMobile.Status.SystemState.ConnectionsDesktopCount <= 0 还有一个从未使用过的属性。
Microsoft.WindowsMobile.Status.SystemState.CradlePresent对于IP部分。
//Get Device Name
var deviceName = System.Net.Dns.GetHostName();
//Get IP Address
IPHostEntry _ipHost = System.Net.Dns.GetHostEntry(deviceName);
var IpAddress = _ipHost.AddressList[0].ToString();对于到the服务的连接,您可以创建bool或int简单方法来测试它是否可用。
网络服务
bool IsAvailable()
{
return true;
}您只需要调用the服务。
https://stackoverflow.com/questions/7776483
复制相似问题