Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Display asterisks password
Message
De
26/11/2000 18:08:37
 
 
À
25/11/2000 15:29:23
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00445392
Message ID:
00445528
Vues:
17
In FPD 2.6 and in FPW 2.6 I wrote this code, which returned a character string user entered:

******************************

procedure psw_input
private all except cPass
push key clear
define window a from 10,15 to 12,65 color w+/r shadow
activate window a
@ 0,1 say "Password:"
nCounter = 1
bStop = .f.
cPass = ""

do while bStop = .f.
nChr = inkey(0,"H")
if nChr < 0
loop
endif
if nChr = 5 or nChr = 24 or nChr = 4
loop
endif
if nChr = 27 &&Escape key
bStop = .t.
cPass = ""
loop
endif
if nChr = 13 &&Enter key
bStop = .t.
loop
endif
if bStop = 127 or bStop = 19 &&Backspace or left key...
if nCounter > 1
nCounter = nCounter - 1
@ 0,(7+nCounter) say " "
cPass = left (cPass, nCounter - 1)
endif
loop
endif

@ 0,(7+nCounter) say "*" color w+/r
cPass = cPass + chr(nChr)
nCounter = nCounter + 1

if nCounter > 40
bStop = .t.
endif
enddo

pop key all
release window a

return cPass

***********************************

HTH, Zlatko.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform