Aracılığıyla paylaş


Dns.GetHostByName(String) Yöntem

Tanım

Dikkat

GetHostByName has been deprecated. Use GetHostEntry instead.

Dikkat

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

Dikkat

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

Belirtilen DNS ana bilgisayar adı için DNS bilgilerini alır.

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

Parametreler

hostName
String

Konağın DNS adı.

Döndürülenler

IPHostEntry içinde hostNamebelirtilen adres için konak bilgilerini içeren bir nesne.

Öznitelikler

Özel durumlar

hostName, null'e eşittir.

uzunluğu hostName 255 karakterden uzundur.

çözümlendiğinde hostNamebir hatayla karşılaşıldı.

Açıklamalar

yöntemi, GetHostByName konak bilgileri için İnternet DNS sunucusunu sorgular. Konak adı olarak boş bir dize geçirirseniz, bu yöntem yerel bilgisayar için standart ana bilgisayar adını alır.

DNS bilgilerine zaman uyumsuz erişim için ve EndGetHostByName yöntemlerini kullanınBeginGetHostByName.

Ipv6Element.Enabled özelliği olarak ayarlanırsatrueAliases, döndürülen örneğin özelliği IPHostEntry bu yöntemle doldurulmazsa ve her zaman boş kalır.

Uyarı

Bu üye, uygulamanızda ağ izlemeyi etkinleştirdiğinizde izleme bilgilerini yayar. Daha fazla bilgi için bkz. .NET Framework'te Ağ İzleme.

Şunlara uygulanır