?? f_login.pas
字號:
unit f_login;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
Tf_log1n = class(TForm)
StaticText1: TStaticText;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
StaticText2: TStaticText;
StaticText3: TStaticText;
procedure Button1Click(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
f_log1n: Tf_log1n;
implementation
uses Unit2;
{$R *.dfm}
procedure Tf_log1n.Button1Click(Sender: TObject);
var
strfile:string;
F: TextFile;
S: string;
mypath:string;
begin
MyPath:=ExtractFilePath(ParamStr(0)); //返回指點文件的路徑 》》//返回指點文件的參數(shù)
strfile:=mypath +'data\p.lyr';
if not FileExists(strfile) then begin
showmessage('找不到密碼初始化文件'+#13+'該文件可能已經(jīng)被刪除'+#13+
'解決該問題請看使用幫助里的[恢復(fù)密碼初始文件]或聯(lián)系我們');
exit;
end;
AssignFile(f,strfile); //
Reset(F); // 打開一個也有的文件名
Readln(F, S); //執(zhí)行Read,跳到下一行文件
CloseFile(F); //關(guān)閉打開的文件
if edit1.Text <>s then begin
showmessage('密碼輸入不正確,請仔細檢查大小寫');
edit1.Text:='';
edit1.SetFocus ;
exit;
end;
f_main.Show;
self.Free;
end;
procedure Tf_log1n.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if ord(key)=13 then
Button1Click(Sender);
end;
procedure Tf_log1n.Button2Click(Sender: TObject);
begin
self.Close;
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -