共用方式為


IPGlobalProperties.DomainName 屬性

定義

取得本機電腦註冊的網域。

public:
 abstract property System::String ^ DomainName { System::String ^ get(); };
public abstract string DomainName { get; }
member this.DomainName : string
Public MustOverride ReadOnly Property DomainName As String

屬性值

String 執行個體,包含電腦的網域名稱。 如果電腦不屬於某個網域,則會傳回 Empty

例外狀況

Win32 函式呼叫失敗。

範例

下列程式代碼範例會顯示本機計算機的網路資訊。

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);

適用於