Monday, July 18, 2005

JAVA调用exe程序,测试成功




public class ExecProgram {

�public static void main (String[] args){

��Runtime rn = Runtime.getRuntime();

��Process p = null;

��String�exeFile = "";


��try{


�� #change exeFile as u�need


���exeFile = "G:\\oatil\\pietty0327.exe";

���p = rn.exec(exeFile);

��}

��catch( Exception e ){

���System.out.println( " ERROR exec progam " );

��}

�}

}



No comments: