Dns.Resolve(String) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Varning
Resolve has been deprecated. Use GetHostEntry instead.
Varning
Resolve is obsoleted for this type, please use GetHostEntry instead. https://go.microsoft.com/fwlink/?linkid=14202
Varning
Resolve is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202
Löser ett DNS-värdnamn eller EN IP-adress till en IPHostEntry instans.
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
Parametrar
- hostName
- String
Ett värdnamn eller EN IP-adress i DNS-format.
Returer
En IPHostEntry instans som innehåller adressinformation om värden som anges i hostName.
- Attribut
Undantag
hostName är null.
Längden hostName på är större än 255 tecken.
Ett fel påträffas när du löser hostName.
Kommentarer
Metoden Resolve frågar en DNS-server efter DEN IP-adress som är associerad med ett värdnamn eller en IP-adress.
När hostName är ett VÄRDnamn i DNS-format som är associerat med flera IP-adresser returneras endast den första IP-adressen som matchar värdnamnet.
Om egenskapen Ipv6Element.Enabled är inställd på trueAliases fylls egenskapen för den returnerade instansen IPHostEntry inte med den här metoden och kommer alltid att vara tom.
Note
Den här medlemmen genererar spårningsinformation när du aktiverar nätverksspårning i ditt program. Mer information finns i Network Tracing in .NET Framework.