Results 1 to 5 of 5

Thread: Password Validation

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    13

    Question

    I'm making a program where you have to enter a passord, and then it executes another exe. I don't know how to do the last part but the password validation should be something like this right:

    Private Sub Form_Load()
    MsgBox "Please enter your password."
    password = Int(password1)
    Do
    input1 = CInt(InputBox("Enter your password below."))
    If (input1 = password) Then
    MsgBox "Your password has been accepted."
    Else
    MsgBox "Invalid password, please try again", vbokonly, "Oops!"
    End If
    End If
    Loop Until input1 = password

    End Sub

    -
    (assuming "password1" is the password)
    But that doesn't seem to work. can anyone help me with this?

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Using a textbox you can have the * character instead of having it to show the password when you type it, just set passwordchar to "*"
    Code:
    Then in a commandbuttons click event you put
    
    If text1="This is your password" then
     Shell Yourfile,vbnormalfocus 'this executes yourfile, which is a string, in normal size with focus, check up shell in vb help
    else
     Msgbox "invalid password"
    end if
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guest

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    13

    Question

    What?!!??!?!?!
    first of all, i don't know what your talking about, and how to use the code (forgive me, i'm just a beginner), and second, i also don't know what to do with the code on the other page...
    Maybe you could explain it a bit more...?

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    That's if you want to have an inputbox like the one you get inputbox function, but with password characters.

    A bit easier, is to just have a form on which you place your textbox. Setting the textbox passwordchar property to *

    And then you make a commandbutton, doubleclick it so that it's click event shows up, paste that code i gave you, replace Yourfile with the filename you want to run (quoted with"")
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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