PASSWORD STATEMENT

Everything that's not related to QuickBasic in any way, eg. general chat

Moderators:Administrator, Global Moderator

Post Reply
NENNERT4
PASSWORD STATEMENT

Post by NENNERT4 » Wed Feb 09, 2005 5:04 pm

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?

oktagon
Newbie
Posts:7
Joined:Sat Feb 11, 2006 7:04 pm
Location:Tholen

Post by oktagon » Wed Feb 22, 2006 2:59 pm

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! :!:

comperr
Newbie
Posts:3
Joined:Mon Dec 18, 2006 6:52 pm

Re: PASSWORD STATEMENT

Post by comperr » Mon Dec 18, 2006 7:02 pm

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.

Zefer
Newbie
Posts:1
Joined:Wed Jul 11, 2007 10:33 pm

Post by Zefer » Wed Jul 11, 2007 10:37 pm

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.
You must have mistaken me for someone who cared.

Post Reply