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 提供型別。