Author |
Message |
Andy
|
Posted: Sun Jan 25, 2004 5:25 pm Post subject: masking passwords |
|
|
i saw danshadow's forum thingny and noticed he didnt mask the passwords so i made this
code: | fcn getpass : string
var pass := ""
var charc : string (1)
loop
getch (charc)
exit when ord (charc) = 10
if ord (charc) = 8 and length (pass) not= 0 then
locate (whatrow, whatcol - 1)
put " " ..
locate (whatrow, whatcol - 1)
pass := pass (1 .. length (pass) - 1)
elsif ord (charc) not= 8 then
pass := pass + charc
put "*" ..
end if
end loop
put ""
result pass
end getpass
put getpass
|
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
shorthair
![](http://www.members.shaw.ca/rfolz/domo-kun.jpg)
|
Posted: Sun Jan 25, 2004 5:40 pm Post subject: (No subject) |
|
|
I like that , its well done , im gonna use that in my app |
|
|
|
|
![](images/spacer.gif) |
Mazer
![](http://compsci.ca/v3/uploads/user_avatars/1323750815476d9f446d80c.png)
|
Posted: Sun Jan 25, 2004 7:16 pm Post subject: (No subject) |
|
|
Why not use setscreen ("noecho") and avoid all that locate nonsense? |
|
|
|
|
![](images/spacer.gif) |
McKenzie
![](http://www.wizards.com/global/images/swtcg_article_27_pic3_en.gif)
|
Posted: Sun Jan 25, 2004 8:06 pm Post subject: (No subject) |
|
|
because the user needs feedback to know that the key was accepted, especially with a wonky kb. Oh in VB just set the passwordChar property to * in your edit box (I'm not kidding) |
|
|
|
|
![](images/spacer.gif) |
shorthair
![](http://www.members.shaw.ca/rfolz/domo-kun.jpg)
|
Posted: Sun Jan 25, 2004 9:24 pm Post subject: (No subject) |
|
|
does hte * represent anything , like in turing ? |
|
|
|
|
![](images/spacer.gif) |
Dan
![](http://wiki.compsci.ca/images/archive/3/3c/20100325043407!Danspic.gif)
|
Posted: Sun Jan 25, 2004 10:35 pm Post subject: (No subject) |
|
|
McKenzie wrote: because the user needs feedback to know that the key was accepted, especially with a wonky kb. Oh in VB just set the passwordChar property to * in your edit box (I'm not kidding)
well the linux poleop have allways bivled that u should not even give out how long the pass is or at least that why i think they make there log in consloe that way ![Rolling Eyes Rolling Eyes](http://compsci.ca/v3/images/smiles/icon_rolleyes.gif) |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
![](images/spacer.gif) |
McKenzie
![](http://www.wizards.com/global/images/swtcg_article_27_pic3_en.gif)
|
Posted: Sun Jan 25, 2004 10:53 pm Post subject: (No subject) |
|
|
For the passwordChar all the * means is that when the user types replace it with a *. You don't actually set it in the code. You just change it in the properties box. You can use any character but * is the most common. |
|
|
|
|
![](images/spacer.gif) |
shorthair
![](http://www.members.shaw.ca/rfolz/domo-kun.jpg)
|
Posted: Sun Jan 25, 2004 10:57 pm Post subject: (No subject) |
|
|
Thanks for clearing that up for me guys , you had me confused for a while ![Very Happy Very Happy](http://compsci.ca/v3/images/smiles/icon_biggrin.gif) |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Mazer
![](http://compsci.ca/v3/uploads/user_avatars/1323750815476d9f446d80c.png)
|
Posted: Mon Jan 26, 2004 10:30 am Post subject: (No subject) |
|
|
McKenzie wrote: because the user needs feedback to know that the key was accepted, especially with a wonky kb. Oh in VB just set the passwordChar property to * in your edit box (I'm not kidding)
I know they need feedback. I'm saying, use noecho so that whatever they type doesn't show up, and whenever they press a key (except backspace and enter), put a * at the location. That's how I did the login for my game, the only difference is that I was using Font.Draw instead of put. |
|
|
|
|
![](images/spacer.gif) |
McKenzie
![](http://www.wizards.com/global/images/swtcg_article_27_pic3_en.gif)
|
Posted: Mon Jan 26, 2004 10:38 am Post subject: (No subject) |
|
|
I'm stupid, you're right ![Embarassed Embarassed](http://compsci.ca/v3/images/smiles/icon_redface.gif) |
|
|
|
|
![](images/spacer.gif) |
Andy
|
Posted: Mon Jan 26, 2004 11:12 am Post subject: (No subject) |
|
|
but there is not much difference... at least i dont think there is |
|
|
|
|
![](images/spacer.gif) |
jonos
![](http://jonos.f2g.net/pictures/rankca.gif)
|
Posted: Mon Jan 26, 2004 11:20 am Post subject: (No subject) |
|
|
i tried making something like that, i couldn't though, that's cool. |
|
|
|
|
![](images/spacer.gif) |
|