PhysicalAddress クラス
アセンブリ: System (system.dll 内)


MAC アドレス (物理アドレス) は、コンピュータやプリンタなどの各ノードをネットワーク上で一意に識別するハードウェア アドレスです。
このクラスのインスタンスは、NetworkInterface.GetPhysicalAddress メソッドによって返されます。

ローカル コンピュータのすべてのインターフェイスの物理アドレスを表示するコード例を次に示します。
public static void ShowNetworkInterfaces() { IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties(); NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces(); Console.WriteLine("Interface information for {0}.{1} ", computerProperties.HostName, computerProperties.DomainName); if (nics == null || nics.Length < 1) { Console.WriteLine(" No network interfaces found."); return; } Console.WriteLine(" Number of interfaces .................... : {0}", nics.Length); foreach (NetworkInterface adapter in nics) { IPInterfaceProperties properties = adapter.GetIPProperties(); // .GetIPInterfaceProperties(); Console.WriteLine(); Console.WriteLine(adapter.Description); Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length,'=')); Console.WriteLine(" Interface type .......................... : {0}", adapter.NetworkInterfaceType); Console.Write(" Physical address ........................ : "); PhysicalAddress address = adapter.GetPhysicalAddress(); byte[] bytes = address.GetAddressBytes(); for(int i = 0; i< bytes.Length; i++) { // Display the physical address in hexadecimal. Console.Write("{0}", bytes[i].ToString("X2")); // Insert a hyphen after each byte, unless we are at the end of the // address. if (i != bytes.Length -1) { Console.Write("-"); } } Console.WriteLine(); } }

System.Net.NetworkInformation.PhysicalAddress


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


PhysicalAddress コンストラクタ
アセンブリ: System (system.dll 内)



新しい PhysicalAddress を作成するコード例を次に示します。
public static PhysicalAddress[] StoreNetworkInterfaceAddresses() { IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties(); NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces(); if (nics == null || nics.Length < 1) { Console.WriteLine(" No network interfaces found."); return null; } PhysicalAddress[] addresses = new PhysicalAddress[nics.Length]; int i = 0; foreach (NetworkInterface adapter in nics) { IPInterfaceProperties properties = adapter.GetIPProperties(); PhysicalAddress address = adapter.GetPhysicalAddress(); byte[] bytes = address.GetAddressBytes(); PhysicalAddress newAddress = new PhysicalAddress(bytes); addresses[i++]=newAddress; } return addresses; }

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


PhysicalAddress フィールド
PhysicalAddress メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 オーバーライドされます。 |
![]() | GetAddressBytes | 現在のインスタンスのアドレスを返します。 |
![]() | GetHashCode | オーバーライドされます。 物理アドレスのハッシュ値を返します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | Parse | 指定された String を解析し、その内容をこのメソッドから返される PhysicalAddress のアドレス バイトとして格納します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | オーバーライドされます。 このインスタンスのアドレスの String 形式を返します。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

PhysicalAddress メンバ
ネットワーク インターフェイス (アダプタ) のメディア アクセス制御 (MAC: Media Access Control) アドレスを提供します。
PhysicalAddress データ型で公開されるメンバを以下の表に示します。



名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 オーバーライドされます。 |
![]() | GetAddressBytes | 現在のインスタンスのアドレスを返します。 |
![]() | GetHashCode | オーバーライドされます。 物理アドレスのハッシュ値を返します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | Parse | 指定された String を解析し、その内容をこのメソッドから返される PhysicalAddress のアドレス バイトとして格納します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | オーバーライドされます。 このインスタンスのアドレスの String 形式を返します。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

Weblioに収録されているすべての辞書からPhysicalAddressを検索する場合は、下記のリンクをクリックしてください。

- PhysicalAddressのページへのリンク