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