IPHostEntry 类

定义

为 Internet 主机地址信息提供容器类。Provides a container class for Internet host address information.

public ref class IPHostEntry
public class IPHostEntry
type IPHostEntry = class
Public Class IPHostEntry
继承
IPHostEntry

示例

下面的示例在 DNS 数据库中查询主机 www.contoso.com 的信息,并返回 IPHostEntry 实例中的信息。The following example queries the DNS database for information on the host www.contoso.com and returns the information in an IPHostEntry instance.

IPHostEntry^ hostInfo = Dns::GetHostEntry( "www.contoso.com" );
IPHostEntry hostInfo = Dns.GetHostEntry("www.contoso.com");
Dim hostInfo As IPHostEntry = Dns.GetHostEntry("www.contoso.com")

注解

IPHostEntry 类将域名系统(DNS)主机名与一组别名和匹配的 IP 地址的数组相关联。The IPHostEntry class associates a Domain Name System (DNS) host name with an array of aliases and an array of matching IP addresses.

IPHostEntry 类用作具有 Dns 类的帮助器类。The IPHostEntry class is used as a helper class with the Dns class.

构造函数

IPHostEntry()

初始化 IPHostEntry 类的新实例。Initializes a new instance of the IPHostEntry class.

属性

AddressList

获取或设置与主机关联的 IP 地址列表。Gets or sets a list of IP addresses that are associated with a host.

Aliases

获取或设置与主机关联的别名列表。Gets or sets a list of aliases that are associated with a host.

HostName

获取或设置主机的 DNS 名称。Gets or sets the DNS name of the host.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅