DeviceNetworkInformation.ResolveHostNameAsync Method (DnsEndPoint, NameResolutionCallback, Object)
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Asynchronously resolves a host name on the first available network interface.
Namespace: Microsoft.Phone.Net.NetworkInformation
Assembly: Microsoft.Phone (in Microsoft.Phone.dll)
Syntax
Public Shared Sub ResolveHostNameAsync ( _
endPoint As DnsEndPoint, _
callback As NameResolutionCallback, _
context As Object _
)
public static void ResolveHostNameAsync(
DnsEndPoint endPoint,
NameResolutionCallback callback,
Object context
)
Parameters
- endPoint
Type: System.Net..::.DnsEndPoint
A host name or IP address.
- callback
Type: Microsoft.Phone.Net.NetworkInformation..::.NameResolutionCallback
A delegate that references the method to invoke when the operation is complete.
- context
Type: System..::.Object
A user-defined object that contains information about the operation.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentNullException | endPoint or callback is nullNothingnullptra null reference (Nothing in Visual Basic). |
Remarks
The context object is passed to the NameResolutionCallback delegate and then stored in the NameResolutionResult class when the operation is complete. If the application calling this method transitions to a dormant state before the callback is fired, a NetworkErrorCode with a value of NameResolutionOperationAborted will be received in the callback.
Version Information
Windows Phone OS
Supported in: 8.1, 8.0, 7.1
Platforms
Windows Phone