import java.io.IOException;
import java.io.InputStream;
public class Text {
public static void main(String[] args) {
try {
String strs = “{\“batchNo\”:\“GCS1001\”,\“billCode\”:\”\“,\“sysCode\”:\“GCS\”,\“sysKey\”:\“sjGCS\”,\“mode\”:\“1\”,\“rights\”:\“1111\”,\“uipUrl\”:\“http://6.106.6.60:80/dev-api\”}”;
String[] cmd = new String[] {
“C:\Northking\NKFileService\ocx\NKFilePRocessApp.exe”,
strs};传入的两个参数
ProcessBuilder pBuilder = new ProcessBuilder(cmd);
Process process = pBuilder.start();
byte[] bytesPool = new byte[10240];
StringBuffer strBuffer = new StringBuffer();
String line = null;
InputStream in = process.getInputStream();
int len = -1;
while ((len = in.read(bytesPool)) != -1) {
line = new String(bytesPool, 0, len);
strBuffer.append(line);
}
in.close();
String str = strBuffer.toString();
System.out.println(str);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}