Java呼叫DOS實現定時關機的實例
複製程式碼程式碼如下:public static void shutdown(){System.out.print("請輸入多少分鐘後關機:");Scanner scanner = new Scanner(System.in);int minute = scanner.nextInt()*60 ;Runtime runtime = Runtime.getRuntime();String shutdown = "shutdown -s -t "+minute;try
2024-11-24