Delphi DeleteFile 删除文件


本文整理自网络,侵删。

 //删除文件 DeleteFile; Windows.DeleteFile
var
f: string;
begin
f := 'c:\temp\test.txt';
//DeleteFile(f); //返回 Boolean

//或者用系统API:
Windows.DeleteFile(PChar(f)); //返回 Boolean
end;

======================

function DeleteFile(const FileName: string): Boolean;
begin
{$IFDEF MSWINDOWS}
Result := Windows.DeleteFile(PChar(FileName));
{$ENDIF}
{$IFDEF LINUX}
Result := unlink(PChar(FileName)) <> -1;
{$ENDIF}
end;

相关阅读 >>

Delphi下idhttp配合cookiemanager获取cookie

Delphi toscilloscope 仿windows任务管理器cpu使用记录组件

Delphi webbrowser设置自己定义user-agent

Delphi indy 组件包里的 idhttp 组件使用 get 方法下载文件限速的方法

Delphi sccoloredid,星际争霸彩色 id 修改器 v0.2.0,支持 windows vista

提供文件操作 单元

Delphi中调用api函数exitwindowsex可以实现系统的关机,注销,和重启

Delphi 2009 中 tstrings 与 tstream 的增强

Delphi tstringlist自定义排序

Delphi pos的用法

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...