在VB 2010中运行AutoIt3脚本 [英] Running AutoIt3 Scripts in VB 2010

查看:75
本文介绍了在VB 2010中运行AutoIt3脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对此很陌生,所以请问我一个愚蠢的问题.

I am fairly new to this, so pardon me if I am asking a silly question.

我在2006年创建了一个用于计算井底压力的应用程序.基本上,它接受用户输入,调用名为REFPROP的辅助应用程序,并将REFPROP结果传递回我的应用程序以继续计算.使用AutoIt,我使用用户输入的内容创建了一个临时文件&另一个带有REFPROP输出.由于REFPROP是cmd提示应用程序,因此该过程非常简单.

I created an application in 2006 that calculates bottom-hole pressure. Basically, it takes the user-inputs, calls a secondary application called REFPROP, and delivers the REFPROP results back to my application to continue the calculations. Using AutoIt, I created a temp file with user inputs & another with REFPROP outputs. Since REFPROP was a cmd prompt application, the process was fairly simple.

现在,我合并到我的应用程序中的REFPROP已过时&新版本的GUI需要多个cmd提示.我想再次使用AutoIt3,但这一次是为用户输入创建一个临时Excel文件,运行REFPROP,创建一个临时输出文件,然后返回到我的应用程序.

Now, the REFPROP I incorporated into my application is outdated & the new version has a GUI that requires more than cmd prompts. I would like to use AutoIt3 again, but this time to create a temp Excel file for user inputs, run REFPROP, create a temp output file, and return to my application.

由于我现在无法在VB 2010环境中运行AutoIt脚本,我有些失落. 我目前的计划是创建&编译AutoIt脚本以打开&使用用户输入来运行REFPROP,但是我不确定该怎么做... 有谁知道最好的方法吗?

I am somewhat lost as I am unable to run AutoIt scripts within my VB 2010 environment right now. My current plan is to create & compile AutoIt scripts to open & run REFPROP with user inputs, but I am not sure of how exactly to go about that... Does anyone have any idea of the best way to go about this?

任何对此的帮助将不胜感激.

Any help with this would be so much appreciated.

谢谢!

推荐答案

实际上非常简单.查看AutoIt脚本论坛和手册中的参考.从处理记录开始,然后从那里开始.

It's actually very easy. Take a look at the references on the AutoIt script forums and in the manual. Start by working with recordings and move from there.

使用regsvr32 AutoItX3.dll并注册DLL.

然后在解决方案中添加项目引用

Then add a project reference inside the solution

然后运行一些这样的代码(这是C#,但概念相同)

Then run some code like this (This is in C#, but the concept works the same)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AutoItX3Lib;

namespace ConsoleApplication2 {
    class Program {
        static void Main(string[] args) {
            AutoItX3Class au3 = new AutoItX3Class();
            while( true ) {
                Console.WriteLine("({0}, {1})" , au3.MouseGetPosX() , au3.MouseGetPosY());

            }
        }
    }
}

这篇关于在VB 2010中运行AutoIt3脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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