NetworkInterface ni = NetworkInterface.getByInetAddress(address);
if (ni != null) {
byte[] mac = ni.getHardwareAddress();
if (mac != null) {
/*
* Extract each array of mac address and convert it to hexa with the
* following format 08-00-27-DC-4A-9E.
*/
for (int i = 0; i < mac.length; i++) {
System.out.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : "");
}
}
}
wie Ausgänge dieser ähnlich speichern 08-00-27-DC-4A-9E
auf eine Variable in JavaSpeichern der 08-00-27-DC-4A-9E an Variable in Java-Byte ist die
08- 08-00- 08-00-27- 08-00-27-DC- 08-00-27-DC-4a- 08 -00-27-DC-4A-9E – sunny
... ich bin in der Lage, es zu einem String zu holen, aber ich habe Ihnen den Ausgang oben gezeigt .... Ich brauche nur 08-00-27-DC-4A-9E in der String s ... – sunny
Danke Gareth .... endlich funktioniert – sunny