Export (0) Print
Expand All

Dns.BeginGetHostByName Method

NOTE: This method is now obsolete.

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

Namespace: System.Net
Assembly: System (in system.dll)

[ObsoleteAttribute(L"BeginGetHostByName is obsoleted for this type, please use BeginGetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")] 
public:
static IAsyncResult^ BeginGetHostByName (
	String^ hostName, 
	AsyncCallback^ requestCallback, 
	Object^ stateObject
)
/** @attribute ObsoleteAttribute("BeginGetHostByName is obsoleted for this type, please use BeginGetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202") */ 
public static IAsyncResult BeginGetHostByName (
	String hostName, 
	AsyncCallback requestCallback, 
	Object stateObject
)
ObsoleteAttribute("BeginGetHostByName is obsoleted for this type, please use BeginGetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202") 
public static function BeginGetHostByName (
	hostName : String, 
	requestCallback : AsyncCallback, 
	stateObject : Object
) : IAsyncResult

Parameters

hostName

The DNS name of the host.

requestCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

stateObject

A user-defined object that contains information about the operation. This object is passed to the requestCallback delegate when the operation is complete.

Return Value

An IAsyncResult instance that references the asynchronous request.

Exception typeCondition

ArgumentNullException

hostName is a null reference (Nothing in Visual Basic).

SocketException

An error was encountered executing the DNS query.

The asynchronous BeginGetHostByName operation must be completed by calling the EndGetHostByName method. Typically, the method is invoked by the requestCallback delegate.

This method does not block until the operation is complete. To block until the operation is complete, use the GetHostByName method.

For detailed information about using the asynchronous programming model, see Calling Synchronous Methods Asynchronously.

NoteNote

This member emits trace information when you enable network tracing in your application. For more information, see Network Tracing.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 1.0, 1.1
Obsolete (compiler warning) in 2.0

.NET Compact Framework

Supported in: 1.0
Obsolete (compiler warning) in 2.0

Reference

Dns Class
Dns Members
System.Net Namespace

Other Resources

Asynchronous Calls

Community Additions

ADD
Show:
© 2014 Microsoft