执行外部程序 [英] Execute external program

查看:65
本文介绍了执行外部程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图制作一个调用外部程序的应用程序,我必须传递两个参数.它没有任何错误.

I tried to make an application that calls an external program that I have to pass two parameters. It doesn't give any errors.

用C ++编写的program.exe拍摄图片并修改.txt文件的内容.

The program.exe, written in C++, takes a picture and modifies the content of a .txt file.

Java程序可以运行,但是什么也没做-

The Java program runs but it does nothing-

这是我的示例代码:

    String[] params = new String [3];
    params[0] = "C:\\Users\\user\\Desktop\\program.exe";
    params[1] = "C:\\Users\\user\\Desktop\\images.jpg";
    params[2] = "C:\\Users\\user\\Desktop\\images2.txt";
    Runtime.getRuntime().exec(params);

推荐答案

更多信息此处

关于如何传递命令的其他问题此处,以及此处

Other issues on how to pass commands here and here

这篇关于执行外部程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆