what am i doing wrong?

Posts 1–5 of 5 · Page 1 of 1
what am i doing wrong?
unable to find entry geasynckeystate in dll user32dll
Code:
Public Class Form1
    <System.Runtime.InteropServices.DllImport("user32.dll")> _
    Private Shared Function GetaSyncKeystate(ByVal vkey As System.Windows.Forms.Keys) As Short
    End Function
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Shell("cmd.exe /c ipconfig/renew")
    End Sub
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        Shell("cmd.exe /c ipconfig/release")
    End Sub
    Private Sub Label1_Click(sender As System.Object, e As System.EventArgs) Handles Label1.Click
        If My.Computer.Network.IsAvailable = True Then
            Label1.Text = "Connected"
            Label1.ForeColor = Color.Lime
            If My.Computer.Network.IsAvailable = False Then
                Label1.Text = "Disconnected"
                Label1.ForeColor = Color.Red
            End If
        End If
    End Sub
    Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
        Dim hotkey As Boolean
        hotkey = GetaSyncKeystate(Keys.L)
        If hotkey = True Then
            Button1.PerformClick()
        End If
    End Sub
End Class
Your declaration is wrong and mis-capitalized.

should be:
Code:
<System.Runtime.InteropServices.DllImport("user32.dll")> _
Private Shared Function GetAsyncKeyState(ByVal vk As Int32) As Int16
End Function
k thanks now the status doesnt work all the time it cheks once the stops
Code:
If My.Computer.Network.IsAvailable = True Then
            Label1.Text = "Connected"
            Label1.ForeColor = Color.Lime
        ElseIf My.Computer.Network.IsAvailable = False Then
                Label1.Text = "Disconnected"
                Label1.ForeColor = Color.Red
        End If
Your logic was wrong.
skip it its fine probaly jus me
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us