package demo1; import java.io.IOException; public class RunTimeDemo { public static void main(String[] args) throws IOException { Runtime r = Runtime.getRuntime(); //r.exec("shutdown -s -t 300");//300秒后电脑自动关机 r.exec("shutdown -a");//取消关机 } }
Runtime单例模式类 -- 控制电脑关机
猜你喜欢
转载自www.cnblogs.com/ivan5277/p/10159685.html
今日推荐
周排行