Java调用外部exe程序方法

2012-11-12

  用java调用外部.exe程序的方法:

  Java代码

  public class Demo{

  public static void main(String args[]){

  Runtime rn = Runtime.getRuntime();

  Process p = null;

  String exeFile = "";

  try{

  exeFile = "D://EditPlus 2//editplus.exe";

  p = rn.exec(exeFile);

  }catch( Exception e ){

  System.out.println( " ERROR exec Editplus.exe " );

  }

  }

  }

分享到:
0
相关阅读
友情链接
© 2018 我考网 http://www.woexam.com 中国互联网举报中心 湘ICP备18023104号 京公网安备 11010802020116号
违法和不良信息举报:9447029@qq.com