Export (0) Print
Expand All

Dns.BeginGetHostByName Method

Begins an asynchronous request for IPHostEntry information about the specified DNS host name.

[Visual Basic]
Public Shared Function BeginGetHostByName( _
   ByVal hostName As String, _
   ByVal requestCallback As AsyncCallback, _
   ByVal stateObject As Object _
) As IAsyncResult
[C#]
public static IAsyncResult BeginGetHostByName(
 string hostName,
 AsyncCallback requestCallback,
 object stateObject
);
[C++]
public: static IAsyncResult* BeginGetHostByName(
 String* hostName,
 AsyncCallback* requestCallback,
 Object* stateObject
);
[JScript]
public static function BeginGetHostByName(
   hostName : String,
 requestCallback : AsyncCallback,
 stateObject : Object
) : IAsyncResult;

Parameters

hostName
A string containing the DNS name of the host.
requestCallback
The AsyncCallback.
stateObject
The State object.

Return Value

An IAsyncResult instance that references the asynchronous request.

Exceptions

Exception Type Condition
ArgumentNullException hostName is a null reference (Nothing in Visual Basic).
SecurityException The caller does not have permission to access DNS information.
SocketException An error was encountered executing the DNS query.

Remarks

The BeginGetHostByName method starts an asynchronous request for DNS host information. The asynchronous callback method uses the EndGetHostByName method to return the actual host information.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

.NET Framework Security: 

See Also

Dns Class | Dns Members | System.Net Namespace | Including Asynchronous Calls

Show:
© 2015 Microsoft