IPInterfaceProperties.DhcpServerAddresses プロパティ
アセンブリ: System (system.dll 内)

Dim instance As IPInterfaceProperties Dim value As IPAddressCollection value = instance.DhcpServerAddresses
public: virtual property IPAddressCollection^ DhcpServerAddresses { IPAddressCollection^ get () abstract; }
DHCP サーバーのアドレス情報を格納している IPAddressCollection。DHCP サーバーが見つからない場合は空の配列。

DHCP (Dynamic Host Configuration Protocol) を使用すると、コンピュータは、静的な (固定) ネットワーク アドレスを使用するのではなく、DHCP サーバーからネットワーク アドレスを取得できます。DHCP サーバーは、永続的にアドレスを割り当てず、代わりに、利用可能なアドレス番号の 1 つを一時的にコンピュータに使用します。

ローカル コンピュータ上のネットワーク インターフェイスについて、DHCP アドレス情報を表示するコード例を次に示します。
Public Shared Sub DisplayDhcpServerAddresses() Console.WriteLine("DHCP Servers") Dim adapters As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces() Dim adapter As NetworkInterface For Each adapter In adapters Dim adapterProperties As IPInterfaceProperties = adapter.GetIPProperties() Dim addresses As IPAddressCollection = adapterProperties.DhcpServerAddresses If addresses.Count > 0 Then Console.WriteLine(adapter.Description) Dim address As IPAddress For Each address In addresses Console.WriteLine(" Dhcp Address ............................ : {0}", address.ToString()) Next address Console.WriteLine() End If Next adapter End Sub 'DisplayDhcpServerAddresses
public static void DisplayDhcpServerAddresses() { Console.WriteLine("DHCP Servers"); NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface adapter in adapters) { IPInterfaceProperties adapterProperties = adapter.GetIPProperties(); IPAddressCollection addresses = adapterProperties.DhcpServerAddresses; if (addresses.Count >0) { Console.WriteLine(adapter.Description); foreach (IPAddress address in addresses) { Console.WriteLine(" Dhcp Address ............................ : {0}", address.ToString()); } Console.WriteLine(); } } }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からIPInterfaceProperties.DhcpServerAddresses プロパティを検索する場合は、下記のリンクをクリックしてください。

- IPInterfaceProperties.DhcpServerAddresses プロパティのページへのリンク