IPGlobalProperties.GetIPGlobalProperties 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得一個物件,提供本地電腦網路連線與流量統計資訊。
public:
static System::Net::NetworkInformation::IPGlobalProperties ^ GetIPGlobalProperties();
[System.Runtime.Versioning.UnsupportedOSPlatform("illumos")]
[System.Runtime.Versioning.UnsupportedOSPlatform("solaris")]
public static System.Net.NetworkInformation.IPGlobalProperties GetIPGlobalProperties();
[System.Runtime.Versioning.UnsupportedOSPlatform("illumos")]
[System.Runtime.Versioning.UnsupportedOSPlatform("solaris")]
[System.Runtime.Versioning.UnsupportedOSPlatform("haiku")]
public static System.Net.NetworkInformation.IPGlobalProperties GetIPGlobalProperties();
public static System.Net.NetworkInformation.IPGlobalProperties GetIPGlobalProperties();
[<System.Runtime.Versioning.UnsupportedOSPlatform("illumos")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("solaris")>]
static member GetIPGlobalProperties : unit -> System.Net.NetworkInformation.IPGlobalProperties
[<System.Runtime.Versioning.UnsupportedOSPlatform("illumos")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("solaris")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("haiku")>]
static member GetIPGlobalProperties : unit -> System.Net.NetworkInformation.IPGlobalProperties
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 。