import java.io.*;public class test {
public static String mac1, bb, cc, dd, netdata;
public test() {
cc = "";
dd = "";
String netdata = "";
try {
java.lang.Process proc = Runtime.getRuntime().exec("ipconfig /all");
InputStream istr = proc.getInputStream();
byte[] data = new byte[1024];
istr.read(data);
netdata = new String(data);
System.out.println(netdata); int indexof = netdata.indexOf("Physical Address");
if (indexof > 0) {
bb = netdata.substring(indexof, netdata.length());
System.out.println("bb" + bb); int indexof1 = bb.indexOf(":");
if (indexof1 > 0)
cc = bb.substring(indexof1 + 1, bb.length()).trim();
System.out.println(cc); dd = cc.substring(0, 17);
System.out.println(dd); } }
catch (IOException e) {
System.out.println("error=" + e);
} }
}public class Untitled1 {
public static void main (String[] args ) {
Test test = new Test();
System.out.println(test.dd);
}
}
public static String mac1, bb, cc, dd, netdata;
public test() {
cc = "";
dd = "";
String netdata = "";
try {
java.lang.Process proc = Runtime.getRuntime().exec("ipconfig /all");
InputStream istr = proc.getInputStream();
byte[] data = new byte[1024];
istr.read(data);
netdata = new String(data);
System.out.println(netdata); int indexof = netdata.indexOf("Physical Address");
if (indexof > 0) {
bb = netdata.substring(indexof, netdata.length());
System.out.println("bb" + bb); int indexof1 = bb.indexOf(":");
if (indexof1 > 0)
cc = bb.substring(indexof1 + 1, bb.length()).trim();
System.out.println(cc); dd = cc.substring(0, 17);
System.out.println(dd); } }
catch (IOException e) {
System.out.println("error=" + e);
} }
}public class Untitled1 {
public static void main (String[] args ) {
Test test = new Test();
System.out.println(test.dd);
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货