Re: Password Generator
- From: Ryan Styles <Ryan@xxxxxxxxxx>
- Date: Wed, 26 Oct 2005 19:03:38 -0400
On Wed, 26 Oct 2005 14:55:36 GMT, "Charles Appel"
<charlesappel@xxxxxxxxxxxxxx> wrote:
>"Ryan Styles" <Ryan@xxxxxxxxxx> wrote in message
>news:ge6tl1pi10eet2nqm2mbvs37opn4mtq6qp@xxxxxxxxxx
>> Hi all.
>>
>> I need to make a password generator which supports plain text, numeric
>> and alphanumeric. Can anyone give me a steer in the right direction so
>> I can find my way in coding this? A link to a resource would be
>> helpful. Just anything to get me going on learning.
>
>const
> LowerAlpha = 'abcdefghijklmnopqrstuvwxyz';
> UpperAlpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
> Numbers = '0123456789';
>
>function AlphaPassword( NumChars: integer): string;
>var
> Upper: Boolean;
> CharCount: integer;
> TempString: string;
>begin
> TempString := '';
> for CharCount := 1 to NumChars do
> begin
> Upper := ( (random(10) + 1) > 5 );
> if Upper then
> TempString := TempString + UpperAlpha[random(26)+1]
> else
> TempString := TempString + LowerAlpha[random(26)+1];
> end;
> result := TempString;
>end;
>
>procedure TForm1.Button1Click(Sender: TObject);
>begin
> Label1.Caption := AlphaPassword(10);
>end;
>
>initialization
> randomize;
>end.
>
>Similar functions could be written to return alphnumeric
>and numeric passwords.
>
Thanks for the code, appreciate the help.
-- Ryan
.
- References:
- Password Generator
- From: Ryan Styles
- Re: Password Generator
- From: Charles Appel
- Password Generator
- Prev by Date: Re: Delphi 7 v Delphi 2005
- Next by Date: Re: Delphi 7 v Delphi 2005
- Previous by thread: Re: Password Generator
- Next by thread: Re: Password Generator
- Index(es):