K
krisjim
Unregistered / Unconfirmed
GUEST, unregistred user!
以上代码不知错在哪, 无论用户验证对错, 都可以进入主界面.
.........
Application.Initialize;
Application.CreateForm(Tadomrp, adomrp);
Application.CreateForm(TFrm_E_Login, Frm_E_Login);
Frm_E_Login.showmodal;
if Frm_E_login.ModalResult =1 then
begin
Frm_E_Login.Free;
.....
Application.CreateForm(TFrm_MainPage, Frm_MainPage);
Application.Run;
end;
procedure TFrm_E_Login.OKBtnClick(Sender: TObject);
begin
XuserID:=Edit1.text;
XuserPassword:=Edit2.Text;
if times<=3 then
with adoMrp.JH_user do
begin
Close;
Parameters.ParamByName('UserID').value:=xUserID;
prepared;
open;
if fieldbyname('userPassword').asstring='...' then
modalresult:=mrok
else
begin
showmessage('用户密码输入错误,无法登录!!'+inttostr(times));
times:=times+1;
edit2.SetFocus;
end;
end
else
application.Terminate;
以上代码不知错在哪, 无论用户验证对错, 都可以进入主界面.
.........
Application.Initialize;
Application.CreateForm(Tadomrp, adomrp);
Application.CreateForm(TFrm_E_Login, Frm_E_Login);
Frm_E_Login.showmodal;
if Frm_E_login.ModalResult =1 then
begin
Frm_E_Login.Free;
.....
Application.CreateForm(TFrm_MainPage, Frm_MainPage);
Application.Run;
end;
procedure TFrm_E_Login.OKBtnClick(Sender: TObject);
begin
XuserID:=Edit1.text;
XuserPassword:=Edit2.Text;
if times<=3 then
with adoMrp.JH_user do
begin
Close;
Parameters.ParamByName('UserID').value:=xUserID;
prepared;
open;
if fieldbyname('userPassword').asstring='...' then
modalresult:=mrok
else
begin
showmessage('用户密码输入错误,无法登录!!'+inttostr(times));
times:=times+1;
edit2.SetFocus;
end;
end
else
application.Terminate;
以上代码不知错在哪, 无论用户验证对错, 都可以进入主界面.