txranger, thankou for your advice and i think is't a good opinion!but
if i use proxy ,by your method,i think i just can obtain the proxy ip!
do you think so?
public class macaddress {
public static void main(String[] args) {
macaddress mdd = new macaddress();
String str=mdd.getMacOnWindow();
System.out.println(str);
}
private static String getMacOnWindow() {
String s = "";
try {
String s1 = "ipconfig /all";
Process process = Runtime.getRuntime().exec(s1);
BufferedReader bufferedreader = new BufferedReader(
new InputStreamReader(process.getInputStream()));
String nextLine;
for (String line = bufferedreader.readLine(); line != null; line = nextLine) {
nextLine = bufferedreader.readLine();
if (line.indexOf("Physical Address") <= 0) {
continue;
}
int i = line.indexOf("Physical Address") + 36;
s = line.substring(i);
break;
}