Topic: "My first c# keylogger" (page 1 of 1)

1
Author Post
beetleflux
groupmaster
I have been learning c# for three weeks now. And I decided to try to make a keylogger. First off, I have some questions:
1:Can i log keyboard events without the program is the 'active' window(because I want to hide it) ?
2:How can I make it disappear from the toolbar(or whatever. i'm norwegian) ?

Here's what I have done so far:
using System;
using System.Windows.Forms;
using System.IO;

public class Keydemo:Form 
{

string log;

public Keydemo() 
{

this.KeyUp += new KeyEventHandler(OnKeyPress);
this.Text="My first keylogger";

}

public void OnKeyPress(object sender, KeyEventArgs e)   
{
log=e.KeyCode.ToString();
StreamWriter strm;
strm=new StreamWriter("C:\\windows\\MyNewFile.txt", true);
strm.Write(log);
 
strm.Close();   

}

public static void Main()  
{
Application.Run(new Keydemo());
}

}

But now the program is visible and it has to be the 'active' window. I want to hide it, and I want to log keyboard events while it is invisible.
private message
Starbob
groupmastergroupmaster
what you are looking for is called "hooking" try google on that
private message

Topic: "My first c# keylogger" (page 1 of 1)

1