判断文件是否存在问题.

sadrwqer32452344 2011-06-26 08:52:13
procedure TForm1.FormCreate(Sender: TObject);
begin
if not FileExists('System.Web.dll') then
showmessage('缺少文件 System.Web.dll !')
else
WinExec( 'System.Web.dll',SW_SHOW);
end;

我想在showmessage('缺少文件 System.Web.dll !')后面加个关闭程序.
但是都报错,各位大虾,这个该怎么弄啊?
另求获取远程链接txt内容公告代码..
...全文
75 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
五哥 2011-06-27
  • 打赏
  • 举报
回复
procedure TForm1.FormCreate(Sender: TObject);
begin
if not FileExists('System.Web.dll') then
begin
showmessage('缺少文件 System.Web.dll !');
Application.Terminate ;
end
else
begin
WinExec( 'System.Web.dll',SW_SHOW);
end;
end;
hongss 2011-06-26
  • 打赏
  • 举报
回复
procedure TForm1.FormCreate(Sender: TObject);
begin
if not FileExists('System.Web.dll') then
begin
showmessage('缺少文件 System.Web.dll !');
Application.Terminate;
end
else
WinExec( 'System.Web.dll',SW_SHOW);
end;
蓝色光芒 2011-06-26
  • 打赏
  • 举报
回复
if not FileExists('System.Web.dll') then
begin
showmessage('缺少文件 System.Web.dll !');
ExitProcess(0);
end
else
....
sadrwqer32452344 2011-06-26
  • 打赏
  • 举报
回复
if not FileExists('System.Web.dll') then
showmessage('缺少文件 System.Web.dll !')
这里加上form1.close报错..
SQLDebug_Fan 2011-06-26
  • 打赏
  • 举报
回复
Application.Terminate,或者直接关闭主窗体。
woaini10000nian 2011-06-26
  • 打赏
  • 举报
回复
Application.Terminate;

16,748

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧