使用 C# 控制另一个应用程序 [英] Control another application using C#

查看:21
本文介绍了使用 C# 控制另一个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过模拟鼠标移动和键盘输入来控制其他应用程序.我如何在 C# 中实现这一点?甚至有可能吗?

I need to control other application by simulating mouse movement and keyboard input. How do I accomplish this in C#? Is it even possible?

推荐答案

你看过白色 TestStack?

示例代码:

Application application = Application.Launch("foo.exe");
Window window = application.GetWindow("bar", InitializeOption.NoCache);

Button button = window.Get<Button>("save");
button.Click();

我认为没有比这更好的了.该库由 ThoughtWorks 创建.

I don't think it can get better than that. The library is created by ThoughtWorks.

这篇关于使用 C# 控制另一个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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