Java如何调用外部Exe程序
可以用一下代码来调用外部的EXE程序:
public class JavaInvokeExe
{
public static void main(String args[])
{
Runtime rt = Runtime.getRuntime();
Process p = null;
String exeFilePath = “”;
try{
exeFilePath = “D:/sample.exe”;
p = rm.exec(exeFilePath);
}catch(Exception e)
{
//TODO do something here
}
}
}
public class JavaInvokeExe
{
public static void main(String args[])
{
Runtime rt = Runtime.getRuntime();
Process p = null;
String exeFilePath = “”;
try{
exeFilePath = “D:/sample.exe”;
p = rm.exec(exeFilePath);
}catch(Exception e)
{
//TODO do something here
}
}
}
【Java如何调用外部Exe程序】相关文章
2. WEB控件及HTML服务端控件能否调用客户端方法?如果能,请解释如何调用?
4. 为什么Runtime.exec(“ls”)没有任何输出?
5. 软件测试LoadRunner面试题:If you want to stop the execution of your script on error, how do you do that?
6. 在C++ 程序中调用被C 编译器编译后的函数,为什么要加extern "C"
本文来源:https://www.mianshiwenti.com/a12461.html
进入下载页面
上一篇:JAVA程序设计笔试题面试题一套
下一篇:Java如何读取CLOB字段