通过ActiveSync连接时从Windows Mobile获取主机PC的IP地址 [英] Get ip address of host pc from windows mobile when connected via ActiveSync
问题描述
我有一个在Windows Mobile上运行的.Net Compact应用程序,并且我希望能够通过ActiveSync连接到在主机计算机(即PDA插入的桌面)上运行的Web服务,但是不知道主机的IP地址。
I have a .Net Compact app running on Windows Mobile, and I want to be able to connect to a webservice running on the 'host' machine (i.e. the desktop the PDA is plugged into) when connected via ActiveSync, but I don't know the ip address of the host. How can I find the ip of the desktop PC progromatically on the PDA?
推荐答案
我如何找到个人计算机在PDA上的收入?我已经找到了一篇知识库文章如何检索使用主机 PPP_Peer的远程PPP对等方的IP地址。所以我尝试了:
I've found a KB article How To Retrieve the IP Address of the Remote PPP Peer, which uses the host "PPP_Peer". So I tried:
Dns.GetHostEntry("PPP_Peer").AddressList[0]
这确实满足了我的需求(目前正在使用的PC上为169.254.2.2)。
And that does give me what I'm looking for (169.254.2.2 on the PC I'm using at the moment).
这篇关于通过ActiveSync连接时从Windows Mobile获取主机PC的IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!