Results 1 to 2 of 2

Thread: Password Code

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    1

    Password Code

    How do you program a primitive password application?
    /|\ The Awen

  2. #2
    Lively Member mindloop's Avatar
    Join Date
    Mar 2004
    Posts
    64
    step1: create a form
    step2: drop a textbox on it (further called textbox1)
    step3: create a button (button1)
    step4: write some code:
    VB Code:
    1. dim mypassword as string = "password" 'initialise the password variable (replace "password" with your desired password)
    2. ' then, on form1_load event :
    3. Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    4. textbox1.passwordchar = "*"
    5. end sub
    on button1.click event write this code:
    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2. if textbox1.text = mypassword then
    3. 'write here some code for the right password, example:
    4. msgbox("correct password")
    5. else
    6. 'write here some code for the wrong password, example:
    7. msgbox("incorrect password")
    8. end if
    9. end sub
    ehmm...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width