我知道关机
Runtime.getRumtime.exec("RunDllEXE User.exe,exitwindow");别忘用TRY把他括起来
Runtime.getRumtime.exec("RunDllEXE User.exe,exitwindow");别忘用TRY把他括起来
解决方案 »
- 本人菜鸟,请教小问题
- 昨天考程序员,卖笔的拿错笔给我了,害我用的是HB填的答题卡。555555555555好难过啊。这样读卡机是不是读不出来了啊、
- 一个编译好的静态Pattern对象在多线程环境使用会不会有问题?
- 透明的水印效果如何实现?在线等....
- 编译中碰到这个问题
- 散一分给沙发
- 这样的功能如何实现?
- 怎么在jsp调用的class中把字符显示到浏览器上
- jbuilder7 和vss集成:我在本地的src目录下加一个包,怎么在status browser里看不到变化?
- I have a dream!! and i have 50 points to send to somebody.........
- java如何实现删除文本文件的行
- 如何填充JCheckBox的颜色,用setBackground()也不行!
{
JButton exitWindows;
public ExitWindows()
{
super("ExitWindows");
setSize(200,240);
setDefaultCLoseOperation(JFrame.EXIT_ON_CLOSE);
exitWindows = new JButton("关机");
exitWindows.AddactionListener(this); JPanel pane = new JPanel();
pane.add(exitWindows); setContentPane(pane);
}
public static void main(String[] args)
{
ExitWindows exit = new ExitWindows();
exit.show();
}
public void actionPerformed(ActionEvent evt)
{
Runtime r = Runtime.getRuntime();
Process p = null; Object src = evt.getSource();
if(scr==exitWindows)
{
try{
r.exec("RUNDLL.EXIT user.exe,exitwindows");
p.waitFor();
}
catch(Exception en) {
System.out.printf(en.toString());
}
}
}
}
请着重看TRY的处理,因为程序可能有错误,我在网吧上网。。最好理解 做成自己想要的格式
是构造函数吗《------仁者见仁,智者见智------》