How to use AutoItX in .NET (C#) without registering

后端 未结 4 967
抹茶落季
抹茶落季 2020-12-07 23:06

How do I use AutoitX (OCX/ActiveX library) in a .NET C# application without registering it?

I would like to create an application with it without need to use adminis

4条回答
  •  猫巷女王i
    2020-12-07 23:44

    In your C# project from Visual Studio, just go to Reference -> Add Reference -> Browse to your AutoIt dll and you're done. There's no need to register it seperately. But using this method you have to register.

    A better way is to use the DLL directly, with [DllImport] statements. Here is a sample class that you can use: http://www.autoitscript.com/forum/topic/72905-c-use-of-the-dll-some-idears-for-you/

    It defines functions like this:

    [DllImport("AutoItX3.dll", SetLastError = true, CharSet = CharSet.Auto)]
    static public extern int AU3_MouseUp([MarshalAs(UnmanagedType.LPStr)] string Button);
    

提交回复
热议问题