Comment faire pour Obtenir l'adresse MAC par programmation en c# pour windows mobile 6.0 appareil
Comment faire pour Obtenir l'adresse MAC par programmation en c# pour windows mobile 6.0 appareil? Le Système.Net.NetworkInformation n'est pas pris en charge dans ,net compatc framework 3.5.
Je sais, ça fait un certain temps, mais j'avais besoin de cela et trouvé que je pouvais utiliser OpenNETCF version du code ci-dessus avec un tweak:
INetworkInterface[] nics =NetworkInterface.GetAllNetworkInterfaces();//for each j you can get the MAC PhysicalAddress address = nics[0].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("-");}}
Je sais, ça fait un certain temps, mais j'avais besoin de cela et trouvé que je pouvais utiliser OpenNETCF version du code ci-dessus avec un tweak:
OriginalL'auteur didge
Nous pouvons utiliser MDSDK dans ce type de problèmes comme
OriginalL'auteur Kapil Arora