Export (0) Print
Expand All

IPHostEntry Class

Provides a container class for Internet host address information.

For a list of all members of this type, see IPHostEntry Members.

System.Object
   System.Net.IPHostEntry

[Visual Basic]
Public Class IPHostEntry
[C#]
public class IPHostEntry
[C++]
public __gc class IPHostEntry
[JScript]
public class IPHostEntry

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

The IPHostEntry class associates a Domain Name System (DNS) host name with an array of aliases and an array of matching IP addresses.

The IPHostEntry class is used as a helper class with the Dns class.

Example

[Visual Basic, C#, C++] The following example queries the DNS database for information on the host www.contoso.com and returns the information in an IPHostEntry instance.

[Visual Basic] 
Dim hostInfo As IPHostEntry = Dns.GetHostByName("www.contoso.com")

[C#] 
IPHostEntry hostInfo = Dns.GetHostByName("www.contoso.com");
   

[C++] 
IPHostEntry* hostInfo = Dns::GetHostByName(S"www.contoso.com");
   

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.Net

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: System (in System.dll)

See Also

IPHostEntry Members | System.Net Namespace | Dns

Show:
© 2014 Microsoft