|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
我先打开,就是登陆窗口,怎么登陆窗口退出时,所有的各系也都关了,请鱼友们帮帮忙好吗? 在这里谢谢了!!!!
unit PHC_login;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TPHC_login1 = class(TForm)
ComboBox1: TComboBox;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Label3: TLabel;
CheckBox1: TCheckBox;
procedure phclogin;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
// procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
PHC_login1: TPHC_login1;
implementation
uses
PHC_DB,PHC_glxt;
var
abc:string; //新让ABC是一个字符串
i:Integer = 3 ; //I变成整数
s:boolean = false; //S变成布尔值
{$R *.dfm}
procedure TPHC_login1.Button2Click(Sender: TObject);
begin
Close;
end;
procedure TPHC_login1.Button1Click(Sender: TObject);
begin
if ComboBox1.Text='' then
application.MessageBox('请输入用户名','提示',64)
else
if edit1.Text='' then
application.MessageBox('请输入密码','提示',64)
else
phclogin;
end;
procedure TPHC_login1.phclogin;
begin
with PHC_DB1.ADOQlogin1 do
begin
close;
sql.Clear;
sql.Add('select * from 用户信息表 where 用户名 = :a and 密码 = :b');
parameters.ParamByName('a').Value:=trim(ComboBox1.Text);
parameters.ParamByName('b').Value:=trim(edit1.Text);
open;
end;
if PHC_DB1.ADOQlogin1.RecordCount>0 then
begin
abc:=PHC_DB1.ADOQlogin1.FieldByName('用户名').Value;
s:=true;
PHC_glxt1.StatusBar1.Panels[1].Text:=abc;
PHC_glxt1.statusbar1.Panels[3].Text:=datetostr(date());
PHC_glxt1.statusbar1.Panels[5].Text:=timetostr(time());
PHC_glxt1.Show;
end
else
begin
i:= i - 1 ;
if i < 1 then
begin
application.MessageBox('你输入密码次数以超过3次,系统将自动关闭!','提示',64);
ComboBox1.Clear;
edit1.Clear;
ComboBox1.SetFocus;
Close;
end
else
begin
Label3.Caption:='还有'+inttostr ( i )+' 机会';
Label3.Visible:=True;
edit1.text:='';
end;
end;
end;
end. |
|