在主窗体运行前弹出一个登陆窗口,通过密码验证的则弹出主窗体,否则则退出程序???这段代码怎样写呀????
解决方案 »
- delphi7里怎么没找到datasource 控件?
- 怎样能获得DBChart的横坐标值呢?
- 用delphi如何做一个类似任务管理器--性能中CUP使用率曲线图的小程序
- savepicturedialog中的filter是什么属性?谢谢
- 如何调出oracle一个用户下的所有数据表?
- 高手进来
- 如何将一个form保存为bmp?在线急等!!!
- 如何将TEXT中的数据导入ACCESS数据库
- 请问: 我目前用的是 XLSReadWriteII V 2.0 版 可遇到 OFFICE 2003 版本就会出错,不知大家会有这样的错误吗?
- 如何制作启动Splash??????
- 我的Dephi 7 ide中没有midas页,该怎么办......? 在线
- CreateOleObject('Excel.Application');出错,错误提示是'不支持此接口'
如果密码正确则free掉登陆窗体,否则,终止应用程序。
俺给你一个让你分析,你体会到了,也就学懂验证了!俺也是菜鸟!
begin
adoquery1.Close;
try adoquery1.SQL.Add('select * from users where [name]='+''''+name+''''+' and [password]='+''''+password+''''); adoquery1.Open;
if adoquery1.RecordCount> 0 then begin
result:=true;
form1.Label1.Caption:='服务器端正在工作!';
end
else
begin
result:=false;
form1.Label1.Caption:='服务器登陆失败!';
end;
except
end;
end;
Application.Initialize;
UserLog := TUserLog.Create(Application);//创建登陆窗体(在些窗体中判断密码是否正确)
if UserLog.ShowModal = mrOK then
begin
UserLog.Free ;
Application.CreateForm(TMain, Main);
Application.Run;
end else
begin
Application.Terminate;
end;以上不知是否理解???