在C#中监控键盘活动,而我的应用程序在后台 [英] Monitoring keyboard activity in C# while my application is in the background

查看:595
本文介绍了在C#中监控键盘活动,而我的应用程序在后台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我需要说清楚,我有键盘记录没有兴趣的。

First of all I need to make it clear that I have no interest in keylogging.

我需要一种方法来监视键盘活动的,而最基本的层面上我应用是在背景中。
我并不需要知道哪些键,我不需要保存任何数据,我不需要或不打算隐瞒我的应用程序在所有的,我需要的是知道什么时候被按下的键,然后调用的方法。

I need a way to monitor keyboard activity at the most basic level while my application is in the background. I don't need to know which keys, I don't need to save any data, I don't need or plan to hide my application at all, all I need is to know when keys are pressed and invoke a method.

我在寻找做这可能是最简单的方法,我知道合理数量的C#但没有太复杂,因为我的大部分知识是自授课。

I'm looking for the simplest way to do this possible, I know a reasonable amount of C# but nothing too complex as most of my knowledge is self-taught.

我环顾四周,这样做的一些适当的方式和我发现没什么用处。所有我发现是一堆人说,在深入键盘记录器上论坛和源代码不,这是非法的对

I've looked around for some appropriate ways of doing this and I've found nothing useful. All I've found is a bunch of people saying "No, that's illegal" on forums and source code for in depth keyloggers.

如果任何你能告诉我有关的方式来实现这个话,我将非常感激。

If any of you could advise me on a way to achieve this then I would be most appreciative.

推荐答案

有就是为你需要什么样的工作样本的文章(

There is an article that has working sample for what you require(It also monitors keyboard and mouse events in the background) at :

处理全球鼠标和键盘在C#鱼钩

这篇关于在C#中监控键盘活动,而我的应用程序在后台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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