zoukankan      html  css  js  c++  java
  • autoit 处理文件上传弹出框,并在JAVA中调用

    Java  代码

    //定义exe 文件存放的绝对路径
    
     File file2 = new File(".");
     String command = file2.getCanonicalPath()+"\resources\pages\testdata\"+"UploadFile.exe";
    
    //Java中调用autoit.exe程序
      Runtime run = Runtime.getRuntime(); 
     try{
           Process pro=run.exec(command);
          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.exe代码:实现功能:将文件的路径粘贴

    WinActivate("Choose file to upload") ControlFocus("Choose file to upload", "", "1148")
    
    Dim $nr 
    
    $nr=ClipGet() 
    
    Send($nr)
    
     Send("{Enter}")
  • 相关阅读:
    java8 file转base64
    springboot下maven分环境打包
    maven加载src下的xml文件
    ue正则
    springboot 深坑
    解压版mysql 错误-mysql启动失败
    spring整合activeMQ
    maven分环境 打包
    logger日志配置
    hadoop安装
  • 原文地址:https://www.cnblogs.com/xriverside/p/4002333.html
Copyright © 2011-2022 走看看