unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
procedure Gen();
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
function generate(cantidad: integer): string;
const
letras_mi = 'ABCDEFGHJKMNPQRSTUVWXYZ23456789';
var i:integer;
begin
Result := '';
for I := 1 to cantidad do
Result := Result + letras_mi[Random(Length(letras_mi)) + 1];
end;
{ TForm1 }
procedure TForm1.Gen();
begin
Edit1.Text:=format('%s-%s-%s-%s-%s',[generate(4),generate(4),generate(4),generate(4),generate(4)]) ;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
if Not FileExists('2days.txt') then ShowMessage('Crack or Unpack it.');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Gen();
end;
end.
Recommended Comments
There are no comments to display.