You can get the mac address by running ipconfig in a DOS prompt and parsing out the data.
//First run ipconfig
Process conf = Runtime.getRuntime().exec("c:/windows/ipconfig.exe /all");
// then parse out the response
DataInputStream ds = new DataInputStream(conf.getInputStream());
while ((String lineItem = ds.readLine()) != null) {
// look for index of "Physical Address" and you have it
}
There is a lot more information returned here as well you might find usefull.
> You can get the mac address by running ipconfig in a
> DOS prompt and parsing out the data.
>
> //First run ipconfig
> Process conf =
> Runtime.getRuntime().exec("c:/windows/ipconfig.exe
> /all");
>
> // then parse out the response
> DataInputStream ds = new
> DataInputStream(conf.getInputStream());
> while ((String lineItem = ds.readLine()) != null) {
> // look for index of "Physical Address" and you have
> e it
> }
>
> There is a lot more information returned here as well
> you might find usefull.
This solution seems platform specific. Do you have a solution that is more portable?