Creating a Simple Key Logger in C#
Written By: Dragos Nicholas
- 13 Sep 2008 -
Description: Learn how to program a simple key logger with the help of C# and the .NET Framework. And that's not all, it saves the keystrokes into a file and periodically sends the file as an email attachment.
- Creating the Project
- Running the Key Logger at Windows Startup
- You've Got Mail
- Intercepting Keystrokes
- The HookCallback Method
- API Methods
- Possible Errors
Possible Errors
All you have to do is put together, one by one, the above blocks of code.
Some possible errors might occur:
- if you see the console, then go to the project Properties and select Windows Application
- you haven't added the System.Windows.Forms reference
- you haven't disposed of the message attachement (data.Dispose())
- you haven't closed the streamwriter (sw.Dispose())