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.
精彩评论