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

查看:485
本文介绍了控制使用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

样code:

   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天全站免登陆