RedParrot Posted October 3, 2019 Posted October 3, 2019 Hi, i try to use autoit in Visual Studio 2019 and C#. I created a .Net Framework 2 C# Window Application and added the reference to the AutoItX3.dll and also added the AutoItX3.dll to the References. While coding i can implement the "using AutoItX3Lib" and get the method suggestions by using the AutoItX Class... But when i run the Programm it fails with the following Error: System.IO.FileNotFoundException HResult=0x80070002 Nachricht = Die Datei oder Assembly "Interop.AutoItX3Lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden. Quelle = <Die Ausnahmequelle kann nicht ausgewertet werden.> Stapelüberwachung: <Die Ausnahmestapelüberwachung kann nicht ausgewertet werden.> So it can't find Interop.AutoItX3Lib or one of it dependencies. Did smbd. got it to work?
DStraathof Posted October 18, 2019 Posted October 18, 2019 Hi RedParrot, I made this little AutoIT script in C# for Google Chrome Authorization box. I used the NuNit Package AutoItX for the proper assemblies in the project. using System; using System.IO; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using AutoIt; namespace chrome_auth { class Program { static void Main(string[] args) { if (args.Length != 2) { Console.WriteLine("Invalid login parameters provided."); } else { Thread.Sleep(3000); AutoItX.Send(args[0], 1); // Username expected Thread.Sleep(1000); AutoItX.Send("{TAB}"); Thread.Sleep(1000); AutoItX.Send(args[1], 1); // Password expected Thread.Sleep(1000); AutoItX.Send("{ENTER}"); } } } } Perhaps this will get you stared.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now