13 Years of Service
24%

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.