开发者

How to get HostName on Win7 Phone

开发者 https://www.devze.com 2023-02-17 18:34 出处:网络
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 HostNameproperty of Microsof

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

精彩评论

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