Re: Password Generator
- From: "Charles Appel" <charlesappel@xxxxxxxxxxxxxx>
- Date: Wed, 26 Oct 2005 14:55:36 GMT
"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.
.
- Follow-Ups:
- Re: Password Generator
- From: Dr John Stockton
- Re: Password Generator
- From: Ryan Styles
- Re: Password Generator
- References:
- Password Generator
- From: Ryan Styles
- Password Generator
- Prev by Date: Re: Password Generator
- Next by Date: Re: ICS FTPServer Disconnect a Client....
- Previous by thread: Re: Password Generator
- Next by thread: Re: Password Generator
- Index(es):