Monitoring keyboard activity in C# while my application is in the background(在我的应用程序在后台时监视 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.
推荐答案
你需要使用 Window Hooks:
You'll need to use Window Hooks:
C# 中的低级键盘挂钩
但请注意,Windows 安全性可能会保护我们免于为所欲为!
But beware, Windows security, may be protecting us from doing what you want!
这篇关于在我的应用程序在后台时监视 C# 中的键盘活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在我的应用程序在后台时监视 C# 中的键盘活动
 
				
         
 
            
        基础教程推荐
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
 
    	 
    	 
    	 
    	 
    	 
    	 
    	 
    	 
						 
						 
						 
						 
						 
				 
				 
				 
				