Hi all,
I want to know if it’s possible to have the mac adress of a computer with a script.
Thanks for help ![]()
Hi all,
I want to know if it’s possible to have the mac adress of a computer with a script.
Thanks for help ![]()
yes, through the System.Net.NetworkInformation namespace
this grabs all off them :
using UnityEngine;
using System.Collections;
using System.Net.NetworkInformation;
public class MacTest : MonoBehaviour {
// Use this for initialization
void Start () {
DisplayDnsConfiguration();
}
public static void DisplayDnsConfiguration()
{
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in adapters)
{
IPInterfaceProperties properties = adapter.GetIPProperties();
Debug.Log(adapter.GetPhysicalAddress().ToString());
}
}
}
Thanks for help !
But this script does’nt work, can you help me ?
I have created de new C Sharp Script named MacTest and paste your code.
I’ve assigned it to an empty game object but nothing happened in the console …