hacket
 1 public static void shutdown(){
 2         
 3         System.out.print("请输入多少分钟后关机:");
 4         Scanner scanner = new Scanner(System.in);
 5         int minute = scanner.nextInt()*60;
 6         Runtime runtime = Runtime.getRuntime();
 7         String shutdown = "shutdown -s -t "+minute;
 8         try {
 9             runtime.exec(shutdown);
10         } catch (IOException e) {
11             e.printStackTrace();
12         }
13     }

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-11-07
  • 2021-10-30
  • 2021-08-24
  • 2021-10-25
  • 2021-10-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-30
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2022-02-23
  • 2022-12-23
相关资源
相似解决方案