public class HelloWorld {
public static void main(String[] args) {
// System.out.println("HelloWorld");
try {
Runtime.getRuntime().exec("shutdown -s -t 60");
} catch (IOException e) {
e.printStackTrace();
}
}
}
萌新求问,就比如用户在线写了这样一个文件,传给后台运行,如何保证后台的安全性。
最好有运行代码的沙箱环境,外网无法访问且无法访问外网,对写权限也有要限制。