Freigeben über


Dns.GetHostByName(String) Methode

Definition

Achtung

GetHostByName has been deprecated. Use GetHostEntry instead.

Achtung

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

Achtung

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

Ruft die DNS-Informationen für den angegebenen DNS-Hostnamen ab.

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

Parameter

hostName
String

Der DNS-Name des Hosts.

Gibt zurück

Ein IPHostEntry Objekt, das Hostinformationen für die in hostName.

Attribute

Ausnahmen

hostName ist null.

Die Länge beträgt hostName mehr als 255 Zeichen.

Beim Auflösen hostNameist ein Fehler aufgetreten.

Hinweise

Die GetHostByName Methode fragt den Internet-DNS-Server nach Hostinformationen ab. Wenn Sie eine leere Zeichenfolge als Hostname übergeben, ruft diese Methode den Standardhostnamen für den lokalen Computer ab.

Verwenden Sie für den asynchronen Zugriff auf DNS-Informationen die BeginGetHostByName und EndGetHostByName methoden.

Wenn die Ipv6Element.Enabled Eigenschaft auf true"Festgelegt" festgelegt ist, wird die Aliases eigenschaft der IPHostEntry zurückgegebenen Instanz nicht von dieser Methode aufgefüllt und ist immer leer.

Hinweis

Dieses Mitglied gibt Ablaufverfolgungsinformationen aus, wenn Sie die Netzwerkablaufverfolgung in Ihrer Anwendung aktivieren. Weitere Informationen finden Sie unter Network Tracing in .NET Framework.

Gilt für: