delphi – 检查目录是否可读
发布时间:2020-12-15 04:19:03 所属栏目:大数据 来源:网络整理
导读:我们如何检查目录是否是readOnly或Not? 解决方法 您可以使用 FileGetAttr 函数并检查是否设置了faReadOnly标志. 试试这段代码 function DirIsReadOnly(Path:string):Boolean;var attrs : Integer;begin attrs := FileGetAttr(Path); Result := (attrs and f
我们如何检查目录是否是readOnly或Not?
解决方法
您可以使用
FileGetAttr 函数并检查是否设置了faReadOnly标志.
试试这段代码 function DirIsReadOnly(Path:string):Boolean; var attrs : Integer; begin attrs := FileGetAttr(Path); Result := (attrs and faReadOnly) > 0; end; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |