📄 denglu.~pas
字号:
unit denglu;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls, DB, ADODB;
type
TForm1 = class(TForm)
Image1: TImage;
Label2: TLabel;
edit1: TEdit;
edit2: TEdit;
Label3: TLabel;
Edit3: TEdit;
Button1: TButton;
Button2: TButton;
Label1: TLabel;
Image2: TImage;
ADOQuery1: TADOQuery;
ADOConnection1: TADOConnection;
DataSource1: TDataSource;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
gdlx:string;
//denglu: Tdenglu;
n:integer;
implementation
{$R *.dfm}
uses dierj,wzcx,xxwh,rkcx;
procedure TForm1.Button1Click(Sender: TObject);
var
pw:string;
xm:string;
yb:real;
xb:real;
begin
adoquery1.Close;
adoquery1.Active:=false;
adoquery1.Connection:=denglu.Form1.ADOConnection1;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * from 工段库房版本');
adoquery1.Open;
xb:=2;
yb:=adoquery1.FieldByName('原版本号').AsFloat;
if xb>yb then
begin
if edit1.Text='' then
begin
application.MessageBox('用户名为空,请输入姓名','login',mb_ok);
end
else
if edit2.Text='' then
begin
application.MessageBox('用户密码为空,请输入密码','login',mb_ok);
end
else
begin
adoquery1.Close;
adoquery1.Active:=false;
adoquery1.Connection:=denglu.Form1.ADOConnection1;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * from 人员表');
adoquery1.SQL.Add('where 姓名='''+edit1.Text+'''');
adoquery1.Active:=true;
adoquery1.Open;
pw:=adoquery1.FieldByName('密码').AsString;
edit3.Text:=edit2.Text;
if edit2.Text=pw then
begin
application.MessageBox('密码正确,欢迎进入','登陆界面',mb_ok);
dierj.Form2.Show;
//edit1.Text:='';
gdlx:=edit1.Text;
//edit2.Text:='';
denglu.form1.Hide;
end
else
begin
n:=n+1;
if n>=3 then
begin
messagedlg('你已失败三次,程序将终止',mtwarning,[mbok],0);
close;
application.Terminate;
exit;
end
else
begin
application.MessageBox('密码错误,请查证后再输入','login',mb_ok);
edit1.Text:='';
edit2.Text:='';
end;
end;
end
end
else
begin
showmessage('对不起,您程序的版本太低,请到网站上下载最新版本的程序.');
form1.Close;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
denglu.Form1.Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -