2011-03-28 202 views
2

我想这样做:是否可以从applet执行命令?

Runtime rt = Runtime.getRuntime(); 

try { 
    rt.exec("notepad"); 
} catch (IOException ioe) { 
    ioe.printStackTrace(); 
} 

内的小应用程序(从本地Html网页中的称呼)这可能吗?我记得在java中的一个安全模型的东西,但我不确定。

+2

你试过了吗? – 2011-03-28 13:17:47

+0

可能重复的[Can trusted 1.5 applets执行系统命令?](http://stackoverflow.com/questions/1240575/can-trusted-1-5-applets-execute-system-commands) – jzd 2011-03-28 13:23:20

+0

顺便说一句 - 为什么你会想要从小应用程序中拉出(空白)记事本?如果这只是一个例子,请提供一个更好的。 – 2011-03-29 00:08:47

回答

相关问题