Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get a random password
Message
From
17/09/2003 15:25:05
 
 
To
17/09/2003 15:00:58
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00830033
Message ID:
00830051
Views:
39
i want to generate a random password how can i do
This is a code from Luis María Guayan posted at PortalFox at http://www.portalfox.com/article.php?sid=770
* FUNCTION GenPass(tnLargo)
*------------------------------------------------
* Generate a random password
* it will contain UpperCase, Lowercase, numbers 
* and special characters.
* numeros
* PARAMETERS: tnLargo: len of the password
* RETURNS: Character
* USE: ? GenPass(15)
*------------------------------------------------

FUNCTION GenPass(tnLargo)
   IF EMPTY(tnLargo)
      tnLargo = 10
   ENDIF
   LOCAL ln, lc, lnI

   *-- Caracteres que contendra la clave generada

   #DEFINE CARACTERES "_0123456789ABCDEFGHYJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
   RAND(-1)
   ln = LEN(CARACTERES)
   lc = ""
   FOR lnI = 1 TO tnLargo
      lc = lc + SUBSTR(CARACTERES, INT(RAND() * ln ) + 1, 1)
   ENDFOR
   RETURN lc
ENDFUNC
*------------------------------------------------
HTH
Apoya a Visual FoxPro usandolo legalmente
--
¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º
Espartaco Palma Martínez
SysOp PortalFox
http://www.portalfox.com
esparta@portalfox.com
Previous
Reply
Map
View

Click here to load this message in the networking platform