Sets the file attributes of a specified file.UnitSysUtilsCategoryfile management routinesfunction FileSetAttr(const FileName: string; Attr: Integer): Integer;DescriptionFileSetAttr sets the file attributes of the file given by FileName to the value given by Attr. The value of Attr is formed by combining the appropriate file attribute constants, as in the following: FileSetAttr('MyFile.sys', faReadOnly or faSysFile);FileSetAttr returns zero if the function was successful. Otherwise the return value is an error code.Note: See TSearchRec for a description of the file attribute constants.
试试这样: { 去掉文件的隐藏属性 } FileSetAttr(FileName, (FileGetAttr(FileName) and (not faHidden)));
Sets the file attributes of a specified file.UnitSysUtilsCategoryfile management routinesfunction FileSetAttr(const FileName: string; Attr: Integer): Integer;DescriptionFileSetAttr sets the file attributes of the file given by FileName to the value given by Attr. The value of Attr is formed by combining the appropriate file attribute constants, as in the following: FileSetAttr('MyFile.sys', faReadOnly or faSysFile);FileSetAttr returns zero if the function was successful. Otherwise the return value is an error code.Note: See TSearchRec for a description of the file attribute constants.
{ 去掉文件的隐藏属性 }
FileSetAttr(FileName, (FileGetAttr(FileName) and (not faHidden)));