使用 AutoIT 自动化远程窗口

发布于 2024-09-18 05:50:06 字数 294 浏览 2 评论 0原文

我想在 C# 应用程序中使用 AutoIT 的 COM 接口来自动化远程计算机上的窗口。我的代码如下所示:

var type = Type.GetTypeFromProgID("AutoItX3.Control", "my-remote-server", true);
var automater = (IAutoItX3) Activator.CreateInstance(type);
automater.DoStuff();

问题是自动化程序似乎无法识别远程计算机上的窗口。我做错了什么吗?这可能吗?

I'd like to use AutoIT's COM interface in a C# application to automate a window on a remote machine. I have code that looks like this:

var type = Type.GetTypeFromProgID("AutoItX3.Control", "my-remote-server", true);
var automater = (IAutoItX3) Activator.CreateInstance(type);
automater.DoStuff();

The problem is that the automater doesn't seem to be recognizing windows on the remote machine. Is there something I'm doing wrong? Is this even possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

阳光下慵懒的猫 2024-09-25 05:50:06

仅当您的 C# 应用程序与您要控制的应用程序位于同一台计算机上时,这才有效。
如果您使用的是远程桌面或 Citrix 等,您在屏幕上看到的只是远程屏幕的位图,但是当您的 C# 应用程序尝试查找有关特定坐标处的窗口的信息时,您所看到的只是一个位图。
使其工作的一种方法是将您的 C# 应用程序放在远程计算机上,并使用共享文件夹中的文件消息或其他方法向其提供远程指令。

this will only work if your c# application is sitting on the same machine as the app you want to control.
If you're using Remote Desktop, or Citrix etc, what you see on the screen is a bitmap of what the remote screen looks like, but when your C# app tries to find information about a window at certain coordinates, all there is is a bitmap.
One way to make it work would be to have your c# app on the remote machine, and using file messages in a shared folder or other methods to give it remote instructions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文