C# - 使用 Thoughtworks White 控制另一个应用程序的窗口
我正在创建一个 C# 程序,并且需要控制另一个应用程序。我发现这个 例如,但它对我来说并不真正有用(或者至少我不能让它工作)。
1)应用程序已经在运行(所以我不能使用 Application application = Application.Launch("foo.exe");
2)它有一个文本框,我需要阅读其中写的内容。
3)然后我想按它的一个按钮(这可以这样做: Button button = window.Get
我也搜索了谷歌,但我没有找到任何有用的东西。
你能帮助我吗?提前致谢。
I'm creating a C# program and I need to control another application. I found this
example, but it doesn't really work for me (or at least I can't make it work).
1) The application is already running (so I can't use Application application = Application.Launch("foo.exe");
2) It has a textbox and I need to read what's written in it.
3) Then I want to press one of its buttons (This can be done with that: Button button = window.Get<Button>("save"); button.Click();
I also searched Google, but I didn't find anything working.
Can you help me? Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
文档没有提到它,但是
Application.Attach()
允许您访问已经运行的程序。从那时起,我希望一切都会按照记录进行。
The documentation doesn't mention it, but
Application.Attach()
allows you to access a program that is already running. From there, I would expect everything would work as documented.