IPGlobalProperties.DomainName 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取在其中注册本地计算机的域。
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);