import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class ClientSocket {
public static void main(String[] args)throws Exception{
getString();
}
//获取本机全部MAC地址
private static void getString() throws IOException{
Process p = Runtime.getRuntime().exec("cmd /C ipconfig /all");
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String str = null;
String Name_Mac = "";
while((str=br.readLine())!=null){
try {
if(!str.substring(0, 1).equals(" "))
Name_Mac += str+" ";
else if(str.indexOf("Physical Address")!=-1){
Name_Mac += str.substring(str.indexOf(":")+1)+"\n";
}
} catch (Exception e) {}
}
System.out.println(Name_Mac);
}
}