您的位置:首页 > 其它

Runtime类

2015-08-26 21:30 211 查看
<pre name="code" class="java">public static void main(String[] args) throws InterruptedException {
Runtime runtime = Runtime.getRuntime();
try {
// 关机:shutdown -s -t 60
// 取消关机:shutdown -a
Process process = runtime.exec("mspaint");
Thread.sleep(3000);
process.destroy();
} catch (IOException e) {
e.printStackTrace();
System.err.println("执行的不是内部命令!");
}
}



                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: