IPGlobalProperties 类

定义

提供有关本地计算机的网络连接的信息。Provides information about the network connectivity of the local computer.

public ref class IPGlobalProperties abstract
public abstract class IPGlobalProperties
type IPGlobalProperties = class
Public MustInherit Class IPGlobalProperties
继承
IPGlobalProperties

示例

下面的代码示例使用此类的实例显示有关本地计算机的信息。The following code example displays information about the local computer using an instance of this class.

void ShowInboundIPStatistics()
{
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   IPGlobalStatistics ^ ipstat = properties->GetIPv4GlobalStatistics();
   Console::WriteLine( "  Inbound Packet Data:" );
   Console::WriteLine( "      Received ............................ : {0}", 
      ipstat->ReceivedPackets );
   Console::WriteLine( "      Forwarded ........................... : {0}", 
      ipstat->ReceivedPacketsForwarded );
   Console::WriteLine( "      Delivered ........................... : {0}", 
      ipstat->ReceivedPacketsDelivered );
   Console::WriteLine( "      Discarded ........................... : {0}", 
      ipstat->ReceivedPacketsDiscarded );
}
public static void ShowInboundIPStatistics()
{
     IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
     IPGlobalStatistics ipstat = properties.GetIPv4GlobalStatistics();
     Console.WriteLine("  Inbound Packet Data:");
     Console.WriteLine("      Received ............................ : {0}",
     ipstat.ReceivedPackets);
     Console.WriteLine("      Forwarded ........................... : {0}",
     ipstat.ReceivedPacketsForwarded);
     Console.WriteLine("      Delivered ........................... : {0}",
     ipstat.ReceivedPacketsDelivered);
     Console.WriteLine("      Discarded ........................... : {0}",
     ipstat.ReceivedPacketsDiscarded);
}
Public Shared Sub ShowInboundIPStatistics() 
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Dim ipstat As IPGlobalStatistics = properties.GetIPv4GlobalStatistics()
    Console.WriteLine("  Inbound Packet Data:")
    Console.WriteLine("      Received ............................ : {0}", ipstat.ReceivedPackets)
    Console.WriteLine("      Forwarded ........................... : {0}", ipstat.ReceivedPacketsForwarded)
    Console.WriteLine("      Delivered ........................... : {0}", ipstat.ReceivedPacketsDelivered)
    Console.WriteLine("      Discarded ........................... : {0}", ipstat.ReceivedPacketsDiscarded)

End Sub

注解

此类提供有关本地计算机的网络接口和网络连接的配置和统计信息。This class provides configuration and statistical information about the local computer's network interfaces and network connections.

此类提供的信息类似于 Internet 协议帮助器 API 函数提供的信息。The information provided by this class is similar to that provided by the Internet Protocol Helper API functions. 有关 Internet 协议帮助器的信息,请参阅 IP 帮助程序。For information about the Internet Protocol Helper, see IP Helper.

构造函数

IPGlobalProperties()

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

属性

DhcpScopeName

获取动态主机配置协议 (DHCP) 范围名。Gets the Dynamic Host Configuration Protocol (DHCP) scope name.

DomainName

获取在其中注册本地计算机的域。Gets the domain in which the local computer is registered.

HostName

获取本地计算机的主机名。Gets the host name for the local computer.

IsWinsProxy

获取 Boolean 值,该值指定本地计算机是否充当 Windows Internet 名称服务 (WINS) 代理。Gets a Boolean value that specifies whether the local computer is acting as a Windows Internet Name Service (WINS) proxy.

NodeType

获取本地计算机的网络基本输入/输出系统 (NetBIOS) 节点类型。Gets the Network Basic Input/Output System (NetBIOS) node type of the local computer.

方法

BeginGetUnicastAddresses(AsyncCallback, Object)

开始一个异步请求,该请求用于检索本地计算机上稳定的单播 IP 地址表。Begins an asynchronous request to retrieve the stable unicast IP address table on the local computer.

EndGetUnicastAddresses(IAsyncResult)

结束挂起的异步请求,该请求用于检索本地计算机上稳定的单播 IP 地址表。Ends a pending asynchronous request to retrieve the stable unicast IP address table on the local computer.

Equals(Object)

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

(继承自 Object)
GetActiveTcpConnections()

返回有关本地计算机上的 Internet 协议版本 4 (IPv4) 和 IPv6 传输控制协议 (TCP) 连接的信息。Returns information about the Internet Protocol version 4 (IPv4) and IPv6 Transmission Control Protocol (TCP) connections on the local computer.

GetActiveTcpListeners()

返回有关本地计算机上的 Internet 协议版本 4 (IPv4) 和 IPv6 传输控制协议 (TCP) 侦听器的终结点信息。Returns endpoint information about the Internet Protocol version 4 (IPv4) and IPv6 Transmission Control Protocol (TCP) listeners on the local computer.

GetActiveUdpListeners()

返回有关本地计算机上的 Internet 协议版本 4 (IPv4) 和 IPv6 用户数据报协议 (UDP) 侦听器的信息。Returns information about the Internet Protocol version 4 (IPv4) and IPv6 User Datagram Protocol (UDP) listeners on the local computer.

GetHashCode()

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

(继承自 Object)
GetIcmpV4Statistics()

提供本地计算机的 Internet 控制消息协议 (ICMP) 版本 4 统计数据。Provides Internet Control Message Protocol (ICMP) version 4 statistical data for the local computer.

GetIcmpV6Statistics()

提供本地计算机的 Internet 控制消息协议 (ICMP) 版本 6 统计数据。Provides Internet Control Message Protocol (ICMP) version 6 statistical data for the local computer.

GetIPGlobalProperties()

获取一个对象,该对象提供有关本地计算机的网络连接和流量统计数据的信息。Gets an object that provides information about the local computer's network connectivity and traffic statistics.

GetIPv4GlobalStatistics()

提供本地计算机的 Internet 协议版本 4 (IPv4) 统计数据。Provides Internet Protocol version 4 (IPv4) statistical data for the local computer.

GetIPv6GlobalStatistics()

提供本地计算机的 Internet 协议版本 6 (IPv6) 统计数据。Provides Internet Protocol version 6 (IPv6) statistical data for the local computer.

GetTcpIPv4Statistics()

提供本地计算机的传输控制协议/Internet 协议版本 4 (TCP/IPv4) 统计数据。Provides Transmission Control Protocol/Internet Protocol version 4 (TCP/IPv4) statistical data for the local computer.

GetTcpIPv6Statistics()

提供本地计算机的传输控制协议/Internet 协议版本 6 (TCP/IPv6) 统计数据。Provides Transmission Control Protocol/Internet Protocol version 6 (TCP/IPv6) statistical data for the local computer.

GetType()

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

(继承自 Object)
GetUdpIPv4Statistics()

提供本地计算机的用户数据报协议/Internet 协议版本 4 (UDP/IPv4) 统计数据。Provides User Datagram Protocol/Internet Protocol version 4 (UDP/IPv4) statistical data for the local computer.

GetUdpIPv6Statistics()

提供本地计算机的用户数据报协议/Internet 协议版本 6 (UDP/IPv6) 统计数据。Provides User Datagram Protocol/Internet Protocol version 6 (UDP/IPv6) statistical data for the local computer.

GetUnicastAddresses()

在本地计算机上检索稳定的单播 IP 地址表。Retrieves the stable unicast IP address table on the local computer.

GetUnicastAddressesAsync()

以一部操作检索本地计算机上稳定的单播 IP 地址表。Retrieves the stable unicast IP address table on the local computer as an asynchronous operation.

MemberwiseClone()

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

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于