private String execNetcfg() {
String result = null;
Runtime runt = Runtime.getRuntime();
DataInputStream dis = null;
try {
Process p = runt.exec("netcfg");
InputStream input = p.getInputStream();
StringBuffer sb = new StringBuffer();
dis = new DataInputStream(input);
String content = null;
while ((content = dis.readLine()) != null) {
sb.append(content).append("\n");
}
result = sb.toString();
} catch (IOException e) {
e.printStackTrace();
}
return result;
}
netcfg获取虚拟网卡
最新推荐文章于 2022-07-07 15:00:13 发布