delphi 小结

1.delphi 与mysql时间问题:

在mysql 中时间以bigint型输出,在delphi中使用UnixToDateTime进行转换时会发生相差8*3600,可以在mysql中加上时间也可以在delphi中加上这段时间,建议在delphi 中加上。DateTimeToUnix 转为数字需要引用DateUtils单元


2.error loading midas.dll  缺失

原因:

MIDAS的全称是Multi- tier Distributed Application Services Suite(多层分布式应用程序服务包)。在使用本系统时,某些操作系统会出现Midas.DLL错误的提示,这种情况一般是操作系统存在问题才会发生的,这就需要对Midas.Dll进行注册。

解决方法: 

在系统“开始”菜单处选择“运行”项,然后在打开的文本框中输入“Regsvr32 Midas.dll”,点击【确定】即可对此文件进行注册。

3.获取cxgrid中当前显示记录数

  形如:cxGrid1DBTableView1.DataController.RecordCount


4.去除字符串中回车换行符“ #$D#$A ”

http://topic.csdn.net/t/20000727/09/16977.html

http://topic.csdn.net/t/20030326/15/1579250.html


5.超时 自动退出

http://topic.csdn.net/u/20100108/09/55a55fca-e7a6-4039-8be7-8ace58a1d46b.html


http://blog.csdn.net/hnxxcxg/article/details/6040251


6.登录次数


要求:当输入的用户名或密码错误时,提示“用户名或密码错误,你还剩3次登陆机会!”  再错就提示“用户名或密码错误,你还剩2次登陆机会!”......最后当3次输入的密码都不正确时退出系统!

 if trim(MMEdit.Text) <> trim(pubQry.FieldByName(’uPas’).AsString) then
        begin
          Logintimes :=Logintimes + 1;
          if Logintimes < 3 then
          begin
          MessageBox(handle,pchar(’错误。密码第’+IntToStr(Logintimes)+’次错误,请重新输入’),’密码错误’,MB_OK OR MB_ICONERROR);
          MMEdit.Text:=’’;
          MMEdit.SetFocus;
          end
          else
          begin
          MessageBox(handle,’密码三次错误。系统将会关闭’,’密码错误’, MB_ICONERROR);
          Application.Terminate;
          end;
        end



方法二:

begin 
if button1.tag>3 then begin 
showmessage('已超过3次错误误'); 
appication.terminate; 
end; 
if 不通过and button1.tag<3 then begin 
showmessage('用户名和密码错误,第'+inttostr(button1.tag+1)+'次错误'); 
button1.tag:=button1.tag+1; 
exit; 
end; 
end;

7.判断密码长度

http://topic.csdn.net/u/20110326/21/0f131069-f76f-4414-9ca9-1cf904f742bc.html


8.判断只能 是字母及数字


procedure Tform.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if Not (key in ['0'..'9', #8, '.',['A'..'Z']]) then
    key := #0;
end;

9.delphi博客

http://www.cnblogs.com/del/


10

http://www.8864.cc/start.asp








评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值