IPGlobalProperties.GetIPGlobalProperties 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取一个对象,该对象提供有关本地计算机的网络连接和流量统计数据的信息。
public:
static System::Net::NetworkInformation::IPGlobalProperties ^ GetIPGlobalProperties();
public static System.Net.NetworkInformation.IPGlobalProperties GetIPGlobalProperties ();
[System.Runtime.Versioning.UnsupportedOSPlatform("illumos")]
[System.Runtime.Versioning.UnsupportedOSPlatform("solaris")]
public static System.Net.NetworkInformation.IPGlobalProperties GetIPGlobalProperties ();
static member GetIPGlobalProperties : unit -> System.Net.NetworkInformation.IPGlobalProperties
[<System.Runtime.Versioning.UnsupportedOSPlatform("illumos")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("solaris")>]
static member GetIPGlobalProperties : unit -> System.Net.NetworkInformation.IPGlobalProperties
Public Shared Function GetIPGlobalProperties () As IPGlobalProperties
返回
一个 IPGlobalProperties 对象,该对象包含有关本地计算机的信息。
- 属性
示例
下面的代码示例显示有关本地计算机的信息。
IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
Console::WriteLine( "Computer name: {0}", properties->HostName );
Console::WriteLine( "Domain name: {0}", properties->DomainName );
Console::WriteLine( "Node type: {0:f}", properties->NodeType );
Console::WriteLine( "DHCP scope: {0}", properties->DhcpScopeName );
Console::WriteLine( "WINS proxy? {0}", properties->IsWinsProxy );
IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
Console.WriteLine("Computer name: {0}", properties.HostName);
Console.WriteLine("Domain name: {0}", properties.DomainName);
Console.WriteLine("Node type: {0:f}", properties.NodeType);
Console.WriteLine("DHCP scope: {0}", properties.DhcpScopeName);
Console.WriteLine("WINS proxy? {0}", properties.IsWinsProxy);
注解
此方法返回的对象是派生自 IPGlobalProperties 类的系统提供的类型。