Page 1 of 1

PASSWORD STATEMENT

Posted: Wed Feb 09, 2005 5:04 pm
by NENNERT4
IM MAKING A PROGRAM, AND I WANTED TO HAVE LIKE A PASSWORD TO GET INTO THE PROGRAM, BUT I DONT KNOW HOW TO GO ABOUT IT...CAN YOU HELP ME OUT?

Posted: Wed Feb 22, 2006 2:59 pm
by oktagon
If you are working with QB 4.5 you can put in your Safe word and then ask the question:Put in your Safeword.
In the next programsentence you control this word by asking :If word=word then continue or goto ..,if not then stop or end! :!:

Re: PASSWORD STATEMENT

Posted: Mon Dec 18, 2006 7:02 pm
by comperr
NENNERT4 wrote:IM MAKING A PROGRAM, AND I WANTED TO HAVE LIKE A PASSWORD TO GET INTO THE PROGRAM, BUT I DONT KNOW HOW TO GO ABOUT IT...CAN YOU HELP ME OUT?
Try creating a basic (unencrprted) password first:
create file pass.dat:

Code: Select all

password_here
in file.bas

Code: Select all

file$="pass.gam"
....
tmp = FREEFILE
open it for append (creates file if no exist)
close it 
....
open it for read
read first line into password
close it
.....

ask for password with print
loop until a$=enter
a$=inkey$
s$ = s$+a$
end loop
if s$ = pass
that was in psudocode. If you want full QB code wait for my tutorial.

Posted: Wed Jul 11, 2007 10:37 pm
by Zefer
Okay, a simple one for QBasic would be:

Code: Select all

cls
Print "Please login:"
dim sPassword as string
input "Password:"; sPassword
if sPassword = "you password here" then beep
else end
That's a very basic way of doing it, but you can expaned from there.