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

适用于