Keramatifar
پنج شنبه 28 خرداد 1383, 12:40 عصر
چگونه یک Password برای اجرای برنامه ایجاد کنیم
کار بسیار ساده ای است، ابتدا یک فرم Password به دلخواه خود ایجاد کنید
سپس کدی شبیه کد زیر در OnButtonClick دکمه فرم قرار دهید:
procedure TPasForm.ButtonClick(Sender: TObject);
var F1:Textfile;
Name:string[20];
Pas:string[15];
begin
try
AssignFile(f1,'sys');
reset(f1);
readln(f1,name);
readln(f1,pas);
if (adiedit.Text=name) and(pasedit.Text=pas) then
close else
Form1.Close;
finally
CloseFile(F1);
end;
end;
then go to Application source code
where it starts like
program xxxxx;
after uses declaration
write this
{$R *.RES}
var Pas:TPasform;
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Pas:=TPasForm.Create(Application);
Pas.Showmodal;
Pas.Update;
Application.Run;
end;
همین...
کار بسیار ساده ای است، ابتدا یک فرم Password به دلخواه خود ایجاد کنید
سپس کدی شبیه کد زیر در OnButtonClick دکمه فرم قرار دهید:
procedure TPasForm.ButtonClick(Sender: TObject);
var F1:Textfile;
Name:string[20];
Pas:string[15];
begin
try
AssignFile(f1,'sys');
reset(f1);
readln(f1,name);
readln(f1,pas);
if (adiedit.Text=name) and(pasedit.Text=pas) then
close else
Form1.Close;
finally
CloseFile(F1);
end;
end;
then go to Application source code
where it starts like
program xxxxx;
after uses declaration
write this
{$R *.RES}
var Pas:TPasform;
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Pas:=TPasForm.Create(Application);
Pas.Showmodal;
Pas.Update;
Application.Run;
end;
همین...