Dns.BeginGetHostByName(String, AsyncCallback, Object) Metodo

Definizione

Attenzione

BeginGetHostByName has been deprecated. Use BeginGetHostEntry instead.

Attenzione

BeginGetHostByName is obsoleted for this type, please use BeginGetHostEntry instead. https://go.microsoft.com/fwlink/?linkid=14202

Attenzione

BeginGetHostByName is obsoleted for this type, please use BeginGetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202

Avvia una richiesta asincrona per IPHostEntry informazioni sul nome host DNS specificato.

public:
 static IAsyncResult ^ BeginGetHostByName(System::String ^ hostName, AsyncCallback ^ requestCallback, System::Object ^ stateObject);
[System.Obsolete("BeginGetHostByName has been deprecated. Use BeginGetHostEntry instead.")]
public static IAsyncResult BeginGetHostByName(string hostName, AsyncCallback? requestCallback, object? stateObject);
[System.Obsolete("BeginGetHostByName is obsoleted for this type, please use BeginGetHostEntry instead. https://go.microsoft.com/fwlink/?linkid=14202")]
public static IAsyncResult BeginGetHostByName(string hostName, AsyncCallback? requestCallback, object? stateObject);
[System.Obsolete("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);
[System.Obsolete("BeginGetHostByName is obsoleted for this type, please use BeginGetHostEntry instead. https://go.microsoft.com/fwlink/?linkid=14202")]
public static IAsyncResult BeginGetHostByName(string hostName, AsyncCallback requestCallback, object stateObject);
public static IAsyncResult BeginGetHostByName(string hostName, AsyncCallback requestCallback, object stateObject);
[<System.Obsolete("BeginGetHostByName has been deprecated. Use BeginGetHostEntry instead.")>]
static member BeginGetHostByName : string * AsyncCallback * obj -> IAsyncResult
[<System.Obsolete("BeginGetHostByName is obsoleted for this type, please use BeginGetHostEntry instead. https://go.microsoft.com/fwlink/?linkid=14202")>]
static member BeginGetHostByName : string * AsyncCallback * obj -> IAsyncResult
[<System.Obsolete("BeginGetHostByName is obsoleted for this type, please use BeginGetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")>]
static member BeginGetHostByName : string * AsyncCallback * obj -> IAsyncResult
static member BeginGetHostByName : string * AsyncCallback * obj -> IAsyncResult
Public Shared Function BeginGetHostByName (hostName As String, requestCallback As AsyncCallback, stateObject As Object) As IAsyncResult

Parametri

hostName
String

Nome DNS dell'host.

requestCallback
AsyncCallback

Delegato AsyncCallback che fa riferimento al metodo da richiamare al termine dell'operazione.

stateObject
Object

Oggetto definito dall'utente che contiene informazioni sull'operazione. Questo oggetto viene passato al requestCallback delegato al termine dell'operazione.

Valori restituiti

IAsyncResult Istanza che fa riferimento alla richiesta asincrona.

Attributi

Eccezioni

hostName è null.

Errore durante l'esecuzione della query DNS.

Commenti

L'operazione asincrona BeginGetHostByName deve essere completata chiamando il EndGetHostByName metodo . In genere, il metodo viene richiamato dal requestCallback delegato.

Questo metodo non viene bloccato fino al completamento dell'operazione. Per bloccare fino al completamento dell'operazione, usare il GetHostByName metodo .

Per informazioni dettagliate sull'uso del modello di programmazione asincrona, vedere Chiamata asincrona di metodi sincroni.

Note

Questo membro genera informazioni di traccia quando si abilita la traccia di rete nell'applicazione. Per altre informazioni, vedere Network Tracing in the .NET Framework.

Si applica a

Vedi anche