Guest User

Untitled

a guest
Jun 21st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. public static void DisplayTypeAndAddress()
  2. {
  3. IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();
  4. NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
  5. Console.WriteLine("Interface information for {0}.{1} ",
  6. computerProperties.HostName, computerProperties.DomainName);
  7. foreach (NetworkInterface adapter in nics)
  8. {
  9. IPInterfaceProperties properties = adapter.GetIPProperties();
  10. Console.WriteLine(adapter.Description);
  11. Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length,'='));
  12. Console.WriteLine(" Interface type .......................... : {0}", adapter.NetworkInterfaceType);
  13. Console.WriteLine(" Physical Address ........................ : {0}",
  14. adapter.GetPhysicalAddress().ToString());
  15. Console.WriteLine(" Is receive only.......................... : {0}", adapter.IsReceiveOnly);
  16. Console.WriteLine(" Multicast................................ : {0}", adapter.SupportsMulticast);
  17. Console.WriteLine();
  18. }
  19. }
Add Comment
Please, Sign In to add comment