• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Delphi Pwd Gen

Status
Not open for further replies.

sQuo

~ KillmeMories ~
Shadow
User
Joined
Oct 16, 2011
Messages
5,851
Reputation
0
Reaction score
22,904
Points
688
Credits
0
‎13 Years of Service‎
24%
pwdgen-darksignstools1bbij.png


Code:
>unit Unit2;

interface

uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs, StdCtrls, Clipbrd, Unit3, jpeg, ExtCtrls;

type
 TForm2 = class(TForm)
   GroupBox1: TGroupBox;
   Edit1: TEdit;
   Label1: TLabel;
   Edit2: TEdit;
   Button1: TButton;
   Button2: TButton;
   Button3: TButton;
   Image1: TImage;
   procedure Edit2Click(Sender: TObject);
   procedure Button1Click(Sender: TObject);
   procedure Button2Click(Sender: TObject);
   function PassWort(PLen:Integer):String;
   procedure Button3Click(Sender: TObject);
 private
   { Private-Deklarationen }
 public
   { Public-Deklarationen }
 end;

var
 Form2: TForm2;
 anzahl: integer;
 str: string;

implementation

{$R *.dfm}


function TForm2.PassWort(PLen:Integer):String;
begin
 Randomize;
 str:= '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ|^°!§$%&/=?+#*-';
 Result:='';
 repeat
   Result:=Result+str[Random(Length(str))+1];
 until(Length(Result)=PLen)
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
 anzahl := StrToInt(Edit2.Text);
 Edit1.Text := PassWort(anzahl);
end;

procedure TForm2.Button2Click(Sender: TObject);
begin
 ClipBoard.AsText := Edit1.Text;
 MessageDlg('Copied to your clipboard!', mtInformation, [mbOK], 0);
end;

procedure TForm2.Button3Click(Sender: TObject);
begin
 Form3.Show;
end;


procedure TForm2.Edit2Click(Sender: TObject);
begin
   Edit2.Text := '';
end;

end.
 
Status
Not open for further replies.
Back
Top