开发者

How to get HostName on Win7 Phone

Since I'm usin开发者_如何学编程g Win7 Phone I can't simply use System.Net.Dns.GetHostName(). How am I supposed to communicate with another phone in this case?


You can use HostName property of Microsoft.Phone.Net.NetworkInformation.NameResolutionResult class.

To asynchronously resolve the host-name use ResolveHostNameAsync(DnsEndPoint, NameResolutionCallback, Object) of Microsoft.Phone.Net.NetworkInformation.DeviceNetworkInformation class.


You cannot do direct phone to phone communication unless your share the URI for raw push notifications.

The recommended approach to achieve this behaviour is to route the messages through a web server/service.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜