C#中的Java Robot类等效代码 [英] Java Robot class eqivalent code in C#

查看:212
本文介绍了C#中的Java Robot类等效代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮我将以下java代码转换为C#。

Can somebody help me in converting the following java code to C#.

Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_WINDOWS);
robot.keyPress(KeyEvent.VK_M);
robot.keyRelease(KeyEvent.VK_WINDOWS);
robot.keyRelease(KeyEvent.VK_M);

我知道我们必须使用'user32.dll'。但我不确定我们必须调用哪些方法。

I understood we have to use 'user32.dll'. But I am not sure which methods we have to call.

推荐答案

如果您正在尝试模拟键盘按键,请阅读以下文章应该帮助你:
http://www.codeproject .com / Articles / 28064 / Global-Mouse-and-Keyboard-Library

If you are trying to simulate keyboard key presses, the following article should help you: http://www.codeproject.com/Articles/28064/Global-Mouse-and-Keyboard-Library

它有一些例子,所以不应该太难理解。

It has examples so it shouldn't be too hard to understand.

这篇关于C#中的Java Robot类等效代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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