/** * 調系統命令 */ try { Process process = Runtime.getRuntime().exec("ipconfig"); Scanner scanner = new Scanner(process.getInputStream(),"gbk"); while (scanner.hasNextLine()){ String str = scanner.nextLine(); System.out.println(str); } scanner.close(); } catch (IOException e) { e.printStackTrace(); }
原文地址:https://www.cnblogs.com/fengdaren/p/8686753.html
时间: 2024-11-11 16:08:54