Java調用EXE程序


String str = null;
Process process = null;
Runtime runtime = Runtime.getRuntime();
// String path="D:/EncryptStr/EncryptStr.exe";
String path="C:/Program Files/EncryptStr/EncryptStr.exe";      //exe程序地址
 
String cmd=path+" "+miqrcode+" "+"秘鑰"; 
process = runtime.exec(cmd);    
InputStream is = process.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
while ((str = reader.readLine()) != null) {
desrqcode1 = "20"+a1_hex+a2_hex+a3_hex+a4_hex+a5_hex+str+"0000000000000000"+sum;
}
process.waitFor();
is.close();
reader.close();
process.destroy();


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM