PASSWORD STATEMENT
Moderators:Administrator, Global Moderator
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?
Re: PASSWORD STATEMENT
Try creating a basic (unencrprted) password first: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?
create file pass.dat:
Code: Select all
password_here
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
Okay, a simple one for QBasic would be:
That's a very basic way of doing it, but you can expaned from there.
Code: Select all
cls
Print "Please login:"
dim sPassword as string
input "Password:"; sPassword
if sPassword = "you password here" then beep
else end
You must have mistaken me for someone who cared.