📄 start.pas
字号:
unit start;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, DBTables, StdCtrls, Mask, DBCtrls;
type
Tpassword = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label5: TLabel;
Label7: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
Label3: TLabel;
ComboBox1: TComboBox;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
count:integer ;
results:variant;
{ Private declarations }
public
{ Public declarations }
end;
var
password: Tpassword;
implementation
uses mydata, w_main;
{$R *.dfm}
procedure Tpassword.Button1Click(Sender: TObject);
begin
count:=count+1;
if combobox1.text='超级管理员' then
begin
results:=data.tcjgly.Lookup('name',edit1.Text,'password'); //检验数据库中的用户及密码项
if results=edit2.Text then
begin
main.StatusBar1.Panels[1].text:='超级管理员登录';
password.hide;
main.show;
main.z2.enabled:=true;
main.z3_2.Enabled :=true;
main.z3_4.Enabled :=true;
main.z4_2.Enabled :=true;
main.z4_5.Enabled :=true;
main.z5.Enabled :=true;
main.z6.Enabled :=true;
main.z7.Enabled :=true;
main.toolbutton3.enabled:=true;
main.toolbutton4.enabled:=true;
main.toolbutton5.enabled:=true;
main.toolbutton11.enabled:=true;
main.toolbutton7.enabled:=true;
main.toolbutton8.enabled:=true;
main.toolbutton9.enabled:=true;
main.toolbutton12.enabled:=true;
main.toolbutton14.enabled:=true;
main.toolbutton15.enabled:=true;
main.toolbutton17.enabled:=true;
main.toolbutton18.enabled:=true;
end
else
begin
application.MessageBox('错误的密码或管理员!','提示',mb_OK);
// showmessage('错误的密码或管理员!');
if (count=3) then
application.terminate; //3次错误系统退出
end
//if combobox1.text='普通管理员' then
end
else
begin
results:=data.tptgly.Lookup('name',edit1.Text,'password'); //检验数据库中的用户及密码项
if results=edit2.Text then
begin
main.z2.enabled:=false;
main.z3_2.Enabled :=false;
main.z3_4.Enabled :=false;
main.z4_2.Enabled :=false;
main.z4_5.Enabled :=false;
main.z5.Enabled :=false;
main.z6.Enabled :=false;
main.z7.Enabled :=false;
main.toolbutton3.enabled:=false;
main.toolbutton4.enabled:=false;
main.toolbutton5.enabled:=false;
main.toolbutton11.enabled:=false;
main.toolbutton7.enabled:=false;
main.toolbutton8.enabled:=false;
main.toolbutton9.enabled:=false;
main.toolbutton12.enabled:=false;
main.toolbutton14.enabled:=false;
main.toolbutton15.enabled:=false;
main.toolbutton17.enabled:=false;
main.toolbutton18.enabled:=false;
main.StatusBar1.Panels[1].Text:='普通管理员登录';
password.hide;
main.show;
end
else
begin
application.MessageBox('错误的密码或管理员!','提示',mb_OK);
//showmessage('错误的密码或管理员!');
if (count=3) then
application.terminate; //3次错误系统退出
end ;
end;
end;
procedure Tpassword.FormCreate(Sender: TObject);
begin
//data.tcjgly.Active :=true; //连接数据库
count:=0;
end;
procedure Tpassword.Button2Click(Sender: TObject);
begin
application.terminate;
end;
procedure Tpassword.FormShow(Sender: TObject);
begin
edit1.Text:='';
edit2.text:='';
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -