下面是一个调用ping的例子(可以改成别的):Runtime runtime = Runtime.getRuntime();
Process process =null;
String ip="自己输的ip";
try{
process =runtime.exec("ping "+ip);
}catch(Exception e){
out.println(e);
runtime.exit(1);
}
Process process =null;
String ip="自己输的ip";
try{
process =runtime.exec("ping "+ip);
}catch(Exception e){
out.println(e);
runtime.exit(1);
}
import java.io.*;
public class send {
public static void main(String[] args){
try{
Runtime.getRuntime().exec("E:/MYSELF/SENDMSG/1.exe"); }catch(IOException e){
} }}
你们说的是服务器端的命令吗?
如果我想让jsp程序停在这里,一直等待
E:/MYSELF/SENDMSG/1.exe这个程序运行结束有什么办法吗?
Runtime.getRuntime().exec("........"); }catch(IOException e){
}
Runtime.getRuntime().exec("C:/windows/command/format.exe");
还混什么呀?