铭毅小子

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();

posted on 2019-07-16 21:18  铭毅小子  阅读(7332)  评论(0编辑  收藏  举报

导航