这是打开和关闭IE的Java代码:
publicclassOpenClose{publicstaticvoidmain(String[] args){while(true){try{
Process p = Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\iexplore.exe \""");
Thread.sleep(5000);
p.destroy();
System.out.println("Return value was "+ p.waitFor());}catch(Exception e){}}}}

发布评论