資源簡介
監聽鍵盤,并在D寫log日志進行分析,其他功能可以自己添加。

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?System.Collections;
namespace?KeyCatch
{
????public?partial?class?Form1?:?Form
????{
????????private?KeyboardHook?kh;
????????private?ArrayList?NumList;
????????public?Form1()
????????{
????????????InitializeComponent();
????????????NumList?=?new?ArrayList();
????????????kh?=?new?KeyboardHook();
????????????kh.Filters?=?“91+82&92+82&164+9&165+9“;
????????????NumList.Add(“91+82“);
????????????NumList.Add(“92+82“);
????????????NumList.Add(“164+9“);
????????????NumList.Add(“165+9“);
????????}
????????//添加過濾
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????NewAction?addnew?=?new?NewAction();
????????????addnew.add?+=?new?AddNewAction(addnew_add);
????????????addnew.Show();
????????}
????????private?void?addnew_add(string?actionstring?num)
????????{
????????????listBox1.Items.Add(action);
????????????NumList.Add(num);
????????}
????????//關閉窗口
????????private?void?button4_Click(object?sender?EventArgs?e)
????????{
????????????this.Close();
????????}
????????//刪除過濾
????????private?void?button2_Click(object?sender?EventArgs?e)
????????{
????????????NumList.RemoveAt(listBox1.SelectedIndex);
????????????listBox1.Items.Remove(listBox1.SelectedItem);
????????}
????????//開始捕捉
????????private?void?button5_Click(object?sender?EventArgs?e)
????????{
????????????kh.BeginHook();
????????????kh.OnKeyIntercepted?+=?new?KeyboardHook.KeyboardHookEventHandler(kh_OnKeyIntercepted);
????????}
????????private?void?kh_OnKeyIntercepted(string?e)
????????{
????????????textBox1.Text?=?e;
????????}
????????//停止捕捉
????????private?void?button6_Click(object?sender?EventArgs?e)
????????{
????????????if?(kh?!=?null)
????????????{
????????????????kh.Dispose();
????????????}
????????}
????????//應用
????????private?void?button3_Click(object?sender?EventArgs?e)
????????{
????????????if?(!kh.IsHooked)
????????????{
????????????????string?filter?=?““;
????????????????foreach?(string?s?in?NumList)
????????????????{
????????????????????filter?+=?s?+?“&“;
????????????????}
????????????????kh.Filters?=?filter.Substring(0?filter.Length?-?1);
????????????}
????????????else
????????????{
????????????????MessageBox.Show(“請先停止捕獲!“?“Error“);
????????????}
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2493??2007-04-22?14:25??KeyCatch\Backup\KeyCatch\Form1.cs
?????文件???????7782??2007-04-22?14:18??KeyCatch\Backup\KeyCatch\Form1.Designer.cs
?????文件???????5814??2007-04-22?14:18??KeyCatch\Backup\KeyCatch\Form1.resx
?????文件??????10769??2007-04-22?14:59??KeyCatch\Backup\KeyCatch\KeyboardHook.cs
?????文件???????3625??2007-04-21?19:30??KeyCatch\Backup\KeyCatch\KeyCatch.csproj
?????文件???????2855??2007-04-22?12:42??KeyCatch\Backup\KeyCatch\NewAction.cs
?????文件???????5594??2007-04-21?17:22??KeyCatch\Backup\KeyCatch\NewAction.Designer.cs
?????文件???????5814??2007-04-21?17:22??KeyCatch\Backup\KeyCatch\NewAction.resx
?????文件????????373??2007-04-21?20:07??KeyCatch\Backup\KeyCatch\Program.cs
?????文件???????1278??2007-04-21?16:36??KeyCatch\Backup\KeyCatch\Properties\AssemblyInfo.cs
?????文件???????2843??2007-04-21?16:36??KeyCatch\Backup\KeyCatch\Properties\Resources.Designer.cs
?????文件???????5612??2007-04-21?16:36??KeyCatch\Backup\KeyCatch\Properties\Resources.resx
?????文件???????1091??2007-04-21?16:36??KeyCatch\Backup\KeyCatch\Properties\Settings.Designer.cs
?????文件????????249??2007-04-21?16:36??KeyCatch\Backup\KeyCatch\Properties\Settings.settings
?????文件????????913??2007-04-21?16:36??KeyCatch\Backup\KeyCatch.sln
????..A..H.?????17408??2007-04-22?19:47??KeyCatch\Backup\KeyCatch.suo
?????文件??????19456??2012-09-21?14:58??KeyCatch\KeyCatch\bin\Debug\KeyCatch.exe
?????文件??????36352??2012-09-21?14:58??KeyCatch\KeyCatch\bin\Debug\KeyCatch.pdb
?????文件??????14328??2012-09-24?13:55??KeyCatch\KeyCatch\bin\Debug\KeyCatch.vshost.exe
?????文件????????490??2007-07-21?02:33??KeyCatch\KeyCatch\bin\Debug\KeyCatch.vshost.exe.manifest
?????文件???????3745??2012-09-21?14:58??KeyCatch\KeyCatch\Form1.cs
?????文件???????7887??2012-09-21?14:58??KeyCatch\KeyCatch\Form1.Designer.cs
?????文件???????5814??2012-09-21?14:58??KeyCatch\KeyCatch\Form1.resx
?????文件??????10769??2007-04-22?14:59??KeyCatch\KeyCatch\KeyboardHook.cs
?????文件???????5653??2012-09-17?11:42??KeyCatch\KeyCatch\KeyCatch.csproj
?????文件????????544??2012-09-17?11:42??KeyCatch\KeyCatch\KeyCatch.csproj.user
?????文件???????2855??2007-04-22?12:42??KeyCatch\KeyCatch\NewAction.cs
?????文件???????5594??2007-04-21?17:22??KeyCatch\KeyCatch\NewAction.Designer.cs
?????文件???????5814??2007-04-21?17:22??KeyCatch\KeyCatch\NewAction.resx
?????文件????????963??2012-09-24?13:55??KeyCatch\KeyCatch\obj\Debug\KeyCatch.csproj.FileListAbsolute.txt
............此處省略37個文件信息
評論
共有 條評論