procedure TForm3.Button3Click(Sender: TObject);
var
attr:integer;
begin
attr := fileGetAttr(ExtractFilePath(Application.ExeName)+'sb.tbr');
if not ((attr and faHidden) = faHidden )then
begin
fileSetAttr(ExtractFilePath(Application.ExeName)+'sb.tbr',attr or faHidden);
MessageBox(0,' 完成','提示',MB_OK);
end;
end;
var
attr:integer;
begin
attr := fileGetAttr(ExtractFilePath(Application.ExeName)+'sb.tbr');
if not ((attr and faHidden) = faHidden )then
begin
fileSetAttr(ExtractFilePath(Application.ExeName)+'sb.tbr',attr or faHidden);
MessageBox(0,' 完成','提示',MB_OK);
end;
end;
本文介绍了一个简单的程序示例,展示了如何使用Delphi检查并修改指定文件的隐藏属性。通过使用fileGetAttr和fileSetAttr函数,可以实现对文件隐藏属性的获取与设置。
842

被折叠的 条评论
为什么被折叠?



