Sign in to follow this  
Followers 0
keen

Blocked Input box

9 posts in this topic

Well im making a application that required a username and password. How can i make it starr our what you are typing in the input box?


[center]Kesne's Bar & Grill[/center]

Share this post


Link to post
Share on other sites



Try reading the help file. Its all in there.

Share this post


Link to post
Share on other sites

Well theres a million things there. Can you tell me where please?


[center]Kesne's Bar & Grill[/center]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Do a help file search.... its pretty self explanatory... you want an inputbox, try looking that up.

Edit: BTW, if you haven't looked through the help file then thats usually what you will be told to do. Make an attempt at your script and if you run into problems that you cant figure out, feel free to make a post.

Edited by BPBNA

Share this post


Link to post
Share on other sites

Welcome,

Try this example

; Get the name
$name = InputBox("Question", "What is your name?", "")

; Get the password
$password = InputBox("Question", "What is your password?", "")

MsgBox(0, 'Answer', $name & " " & $password)

:whistle:

Share this post


Link to post
Share on other sites

And if you want a masked password :whistle: change $password line like this:

$password = InputBox("Question", "What is your password?", "","*")

Share this post


Link to post
Share on other sites

How can I make it so yo need the correct username and password?


[center]Kesne's Bar & Grill[/center]

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

You could put it inside a while loop and have it compare the string they enter the password and only exit the loop when its correct.

While $pass <> "mypassword"
    $pass = InputBox("Password", "Enter your password", "" , "*M")
WEnd

The * makes it so every keystroke comes out as * instead of the real character and the M as the second character of that parameter makes entering something into the box mandatory so they cannot enter a blank(you can just remove the M if you want them to be able to)

Edited by BPBNA

Share this post


Link to post
Share on other sites

Most get 3 tries so this code will do that for you

For $i = 1 To 3
    ; Get the name
    $name = InputBox("Question count:" & $i, "What is your name?", "")
    If $name <> 'John' Then ContinueLoop
    ; Get the password
    $password = InputBox("Question count:" & $i, "What is your password?", "")
    If $password = 'JibbaJabba' Then ExitLoop 
Next

If $i > 3 Then
    MsgBox(0, 'You failed', 'Goodbye')
    Exit 1
EndIf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0