moneybhai wrote:
well,this is my code for retrieving the mac address thru aglet2.0.2 .
But the solution is not coming properly.... please suggest a proper
way to retieve the mac address thru aglet2.0.2.......
If you are at Java 1.6 then you can use:
Enumeration e = NetworkInterface.getNetworkInterfaces();
while(e.hasMoreElements()) {
NetworkInterface ni = (NetworkInterface)e.nextElement();
System.out.println("Net interface: " + ni.getName());
byte[] mac = ni.getHardwareAddress(); if(mac != null) {
System.out.printf("%02X:%02X:%02X:%02X:%02X:%02X\n",mac[0],mac[1],mac[2],mac[3],mac[4],mac[5]);
}
}
to retrieve the MAC address.....