当前位置: 技术问答>java相关
请问JAVA中如何获取到本机网卡的MAC码???
来源: 互联网 发布时间:2017-04-02
本文导语: 谢谢 回答! | try { Process p1 = Runtime.getRuntime().exec("ipconfig /all"); BufferedReader br=new BufferedReader(new InputStreamReader(p1.getInputStream())); String buf=br.readLine(); whi...
谢谢 回答!
|
try {
Process p1 = Runtime.getRuntime().exec("ipconfig /all");
BufferedReader br=new BufferedReader(new InputStreamReader(p1.getInputStream()));
String buf=br.readLine();
while(buf!=null){
System.out.println(buf);
buf=br.readLine();
}
}
catch (Exception e) {
}
Process p1 = Runtime.getRuntime().exec("ipconfig /all");
BufferedReader br=new BufferedReader(new InputStreamReader(p1.getInputStream()));
String buf=br.readLine();
while(buf!=null){
System.out.println(buf);
buf=br.readLine();
}
}
catch (Exception e) {
}