标签:io os java 文件 sp c on cti 代码
File file2 = new File(".");
String command = file2.getCanonicalPath()+"\\resources\\pages\\testdata\\"+"UploadFile.exe";
//exe 文件存放的绝对路径
Runtime run = Runtime.getRuntime();
try{
Process pro=run.exec(command);
//Java调用autoit.exe程序
BufferedInputStream in=new BufferedInputStream(pro.getInputStream());
BufferedReader br=new BufferedReader(new InputStreamReader(in));
String s;
while((s=br.readLine())!=null){
System.out.println(s);
} }
catch(IOException e){
System.out.println(e);
}
=========================================================
Autoit代码:
WinActivate("Choose file to upload") ControlFocus("Choose file to upload", "", "1148")
Dim $nr
$nr=ClipGet()
Send($nr)
Send("{Enter}")
标签:io os java 文件 sp c on cti 代码
原文地址:http://www.cnblogs.com/xriverside/p/4002333.html