There are a good number of postings on this forum about hiding passwords. You might want to do a Keyword Search to read them.
Basically they involve either:
1. Using a different font (such as WingDings, etc.) to display your password in a non-readable manner.
2. Use a more simplistic INPUT routine where you read in the password characters one at a time and programatically send back the 'echo' characters of your choice instead of using an automatic character 'echo'.
The Font method most likely won't work for DOS since I don't think there are non-readable DOS fonts (I could be wrong).
The other method does work in DOS (I have done it). It seems somewhat "clumsy", but operational.
I will add that encryption is a good thing. If your users can get into the password file via Excel (or something else) and easily read everyone's password, how much value is it?
Good Luck,
JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
WildSwan's suuggestion is a fast and easy one, however please be advised that the text will still show up when the user highlights it, so to make the solution more complete change the highlight to match as well. this will make the text truly invisible.
Slighthaze = NULL
[ul][li]FAQ184-2483 An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
* password routine
SET CONFIRM OFF
SET BELL OFF
PUBLIC abc
STORE ' ' TO a,b,c,d,e,f,g,h
STORE ' ' TO abc
@ 10, 10 SAY 'Please enter password:' GET abc
CLEAR GETS
@ 10, 33 GET a PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 33 SAY '*' COLOR W+/BG
IF a=SPACE(1)
STORE SPACE(8) TO abc
RETURN
ENDIF
@ 10, 34 GET b PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 34 SAY '*' COLOR W+/BG
IF b=SPACE(1)
abc=a+SPACE(7)
RETURN
ENDIF
@ 10, 35 GET c PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 35 SAY '*' COLOR W+/BG
IF c=SPACE(1)
abc=a+b+SPACE(6)
RETURN
ENDIF
@ 10, 36 GET d PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 36 SAY '*' COLOR W+/BG
IF d=SPACE(1)
abc=a+b+c+SPACE(5)
RETURN
ENDIF
@ 10, 37 GET e PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 37 SAY '*' COLOR W+/BG
IF e=SPACE(1)
abc=a+b+c+d+SPACE(4)
RETURN
ENDIF
@ 10, 38 GET f PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 38 SAY '*' COLOR W+/BG
IF f=SPACE(1)
abc=a+b+c+d+e+SPACE(3)
RETURN
ENDIF
@ 10, 39 GET g PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 39 SAY '*' COLOR W+/BG
IF g=SPACE(1)
abc=a+b+c+d+e+f+SPACE(2)
RETURN
ENDIF
@ 10, 40 GET h PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 40 SAY '*' COLOR W+/BG
IF h=SPACE(1)
abc=a+b+c+d+e+f+g+SPACE(1)
RETURN
ENDIF
abc=a+b+c+d+e+f+g+h
RETURN
set inte off
Define window pass from 09,22 to 15,53 title '** SECURITY **' colo sche 1 SHADOW
password="7861"
set colo to
passkeyed=' '
pass=''
count=0
key=0
set curs off
activ wind pass
move wind pass center
@02,06 say ' ' colo br
@01,06 SAY " Enter Password : " colo br*
@02,12 get passkeyed when check() colo br
read cycle
rele windows pass
if lastkey() = 27
clea wind
retu
endif
func check
do while key # 13
count = count +1
key = inkey(0)
pass = upper(alltrim(pass+chr(key)))
passkeyed = stuff(passkeyed,count,1,'*')
show get passkeyed
Enddo
Do Case
Case pass = password
clea read
clea wind
do gamtra1
Case pass!=password
wait wind 'Password Invalid.' nowait
clea read
Endcase
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.