PDA

Visualizza la versione completa : [JAVA] ricavare l'indirizzo MAC


magnus
17-09-2004, 13:42
E possibile?

Ciao!

magnus
17-09-2004, 13:59
Ho trovato questo:

public class EthZeroMacAddress {
public EthZeroMacAddress() {
}
static {
System.loadLibrary("getmac");
}
public native String getMacAddress();
public static void main(String[] args) {
EthZeroMacAddress eth0 = new EthZeroMacAddress();
System.out.println("ETH0 MAC ADDRESS=" + eth0.getMacAddress());
}
}

Qualcuno sa aiutarmi ad usare questa classe?

magnus
17-09-2004, 14:02
Mi viene restituito questo errore:

java.lang.UnsatisfiedLinkError: no getmac in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1491)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at EthZeroMacAddress.<clinit>(EthZeroMacAddress.java:5)
Exception in thread "main"

Loading