调用windows Ipconfig信息

    public static void main(String[] args) {
    try {
Runtime r = Runtime.getRuntime();
Process p = r.exec("ipconfig");
BufferedReader br = new BufferedReader(new InputStreamReader(p
.getInputStream()));
p.getOutputStream().flush();
p.getOutputStream().close();
String message = "";
while ((message = br.readLine()) != null) {
System.out.println(message);
}
} catch (Exception e) {
// TODO: handle exception
}
}
   

你可能感兴趣的:(windows)