如何使登录失败后自动退出应用程序(50分)

L

Liuym

Unregistered / Unconfirmed
GUEST, unregistred user!
想使应用程序一开始进入登录窗口,登录成功继续执行,失败则退出
应用程序,在Delphi中怎样做?
 
方法有三:
1: 在dpr中修改:
begin
if Login = true then
begin
application.initialize;
application.createform(...);
....
application.run;
end;
end;
2. 在主窗体的OnCreate事件中:
procedure TmainForm.Oncreate(....);
begin
if Not Login(...) then
Halt(1)
else
......
end;
3.将2中的Halt(1)该为Application.terminate,也行,只是有时窗口会闪一下.
 
接受答案了.
 

Similar threads

回复
0
查看
554
不得闲
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
743
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
顶部