Condividi tramite


Dns.Resolve(String) Metodo

Definizione

Attenzione

Resolve has been deprecated. Use GetHostEntry instead.

Attenzione

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

Attenzione

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

Risolve un nome host DNS o un indirizzo IP in un'istanza IPHostEntry di .

public:
 static System::Net::IPHostEntry ^ Resolve(System::String ^ hostName);
[System.Obsolete("Resolve has been deprecated. Use GetHostEntry instead.")]
public static System.Net.IPHostEntry Resolve(string hostName);
[System.Obsolete("Resolve is obsoleted for this type, please use GetHostEntry instead. https://go.microsoft.com/fwlink/?linkid=14202")]
public static System.Net.IPHostEntry Resolve(string hostName);
[System.Obsolete("Resolve is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
public static System.Net.IPHostEntry Resolve(string hostName);
public static System.Net.IPHostEntry Resolve(string hostName);
[<System.Obsolete("Resolve has been deprecated. Use GetHostEntry instead.")>]
static member Resolve : string -> System.Net.IPHostEntry
[<System.Obsolete("Resolve is obsoleted for this type, please use GetHostEntry instead. https://go.microsoft.com/fwlink/?linkid=14202")>]
static member Resolve : string -> System.Net.IPHostEntry
[<System.Obsolete("Resolve is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")>]
static member Resolve : string -> System.Net.IPHostEntry
static member Resolve : string -> System.Net.IPHostEntry
Public Shared Function Resolve (hostName As String) As IPHostEntry

Parametri

hostName
String

Nome host o indirizzo IP in stile DNS.

Restituisce

IPHostEntry Istanza che contiene informazioni sull'indirizzo sull'host specificato in hostName.

Attributi

Eccezioni

hostName è null.

La lunghezza di hostName è maggiore di 255 caratteri.

Si verifica un errore durante la risoluzione di hostName.

Commenti

Il Resolve metodo esegue una query su un server DNS per l'indirizzo IP associato a un nome host o a un indirizzo IP.

Quando hostName è un nome host in stile DNS associato a più indirizzi IP, viene restituito solo il primo indirizzo IP risolto in tale nome host.

Se la Ipv6Element.Enabled proprietà è impostata su true, la Aliases proprietà dell'istanza IPHostEntry restituita non viene popolata da questo metodo e sarà sempre vuota.

Annotazioni

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

Si applica a