Bagikan melalui


IPGlobalProperties.DomainName Properti

Definisi

Mendapatkan domain tempat komputer lokal terdaftar.

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

Nilai Properti

String Instans yang berisi nama domain komputer. Jika komputer bukan milik domain, mengembalikan Empty.

Pengecualian

Panggilan fungsi Win32 gagal.

Contoh

Contoh kode berikut menampilkan informasi jaringan untuk komputer lokal.

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

Berlaku untuk