procedure tform1.bitbtnclick(sender:tobject);
varpwdfile:textfile;
pwdstr:string;
begin
ifcheckbox1.checked=true then
assignfile((pwdfile,'d:\data\管理员.cfg')
else
assignfile(pwdfile,'d:\data\学生.cfg');
reset(pwdfile);
readln(pwdfile,pwdstr);
closefile(pwdfile);
times:=times+1;
if edit1.text=pwdstr then
begin
if checkbox1.checked=truethenform5.show;
elseform7.show;
end
else
begin
if messagedlg('错误',mtcomfirmation,[mbyes,mbno],0)=mryes then
close
else if times<3 then edit1.setfocus
else
begin
messagedlg('错误',mtinformation,[mbok],0);
application.terminate;
end;
end;
end;
这是一段登陆窗口源程序,问cfg文件如何生成,如用TEXTFILE生成CFG文件用笔记本能打开.生成cfg文件,要求不能用笔记本打开,否则密码泄露。DELPHI是否有此方法,最好不另用加密文件。