Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get a random password
Message
 
 
À
17/09/2003 15:00:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00830033
Message ID:
00830051
Vues:
37
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform