duck

duck

Oct 13th, 2009
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Net.NetworkInformation;
  4. using System;
  5.  
  6. public class NetworkInfo {
  7.  
  8. public static void DisplayTypeAndAddress()
  9. {
  10. //IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();
  11. NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
  12. Debug.Log(nics.Length + " nics");
  13. //Debug.Log("Interface information for "+computerProperties.HostName+"."+computerProperties.DomainName);
  14. foreach (NetworkInterface adapter in nics)
  15. {
  16. IPInterfaceProperties properties = adapter.GetIPProperties();
  17. Debug.Log(adapter.Description);
  18. Debug.Log(String.Empty.PadLeft(adapter.Description.Length, '='));
  19. Debug.Log(" Interface type .......................... : " + adapter.NetworkInterfaceType);
  20. Debug.Log(" Physical Address ........................ : " + adapter.GetPhysicalAddress().ToString());
  21. Debug.Log(" Is receive only.......................... : " + adapter.IsReceiveOnly);
  22. Debug.Log(" Multicast................................ : " + adapter.SupportsMulticast);
  23. }
  24. }
  25.  
  26.  
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment