用rumtime.exec(String s)来调用外部程序,然后用process的getOutputStream来判断是否成功调用。

解决方案 »

  1.   

    fangw说的算是一种方法,不过太奢侈了吧?joeblackyang说的正好和我想的背道而驰了。照你的做法就必须等外部程序执行完毕才能接着做下一步的事情了。
      

  2.   

    Joeblackyang(野Heart)能說的清楚些嗎?謝謝!
      

  3.   

    thisRuntime = java.lang.Runtime.getRuntime();
    thisProcess = thisRuntime.exec(strExeCmd);
    thisProcess.waitFor();
    exitCode = thisProcess.exitValue();
    可以在waitFor之前取exitValue,然后判断,