大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> 程序开发 -> 自定义错误捕捉信息

自定义错误捕捉信息

时间: 2021-07-31 作者:daque

application东西的onexception事变不妨捕获一切运用步调中未处置的缺点,  用一个自设置因变量重定向application.onexception,而后在该因变量中的e参数不妨归来运用步调缺点的东西,确定英文缺点代码能否包括在e.message确定能否用对应华文提醒包办。固然,不妨运用自设置的动静窗体表露。  procedure tform1.handleerror(sender: tobject; e: exception);  begin    if pos('can not link database',e.message)>0 then    begin      showmessage('不许贯穿数据库!');  //不妨用字设置窗体表露      exit;    end;    if pos('tcp/ip……',e.message)>0 then    begin      showmessage('搜集妨碍,不许贯穿数据库!');  //不妨用字设置窗体表露      exit;    end;    ……  end;  procedure tform1.formcreate(sender: tobject);  begin    application.onexception:=handleerror;  end;

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.