Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Borrowed from <a href="http://msdn.microsoft.com/en-us/library/system.net.networkinformation.physicaladdress.aspx" rel="noreferrer">MSDN</a>, tested on VS2008 and mono 2.4.2.3 (Debian 2.4.2.3+dfsg-2):</p> <pre><code>using System; using System.Net.NetworkInformation; namespace ConsoleApplication2 { class Program { 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 &lt; 1) { Console.WriteLine(" No network interfaces found."); return; } Console.WriteLine(" Number of interfaces .................... : {0}", nics.Length); foreach (NetworkInterface adapter in nics) { Console.WriteLine(); Console.WriteLine(adapter.Description); Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length, '=')); Console.WriteLine(" Interface type .......................... : {0}", adapter.Netwo$ Console.Write(" Physical address ........................ : "); PhysicalAddress address = adapter.GetPhysicalAddress(); byte[] bytes = address.GetAddressBytes(); for (int i = 0; i &lt; 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(); } } static void Main(string[] args) { ShowNetworkInterfaces(); } } } </code></pre> <p>outputs (linux):</p> <pre><code>Interface information for hera.(none) Number of interfaces .................... : 2 lo == Interface type .......................... : Loopback Physical address ........................ : eth0 ==== Interface type .......................... : Ethernet Physical address ........................ : 00-26-xx-xx-xx-xx </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload