GetFileAttributes( LPCTSTR lpFileName // address of the name of a file or directory );或则用于(NT) BOOL GetFileAttributesEx( LPCTSTR lpFileName, // pointer to string that specifies a file or directory GET_FILEEX_INFO_LEVELS fInfoLevelId, // value that specifies the type of attribute information to obtain LPVOID lpFileInformation // pointer to buffer to receive attribute information );
有api函数,是什么你查一下吧
var vSearchRec: TSearchRec; begin FindFirst('C:\temp.txt', faAnyFile, vSearchRec); ShowMessage(DateTimeToStr(FileDateToDateTime(vSearchRec.Time))); ShowMessage(IntToStr(vSearchRec.Size)); FindClose(vSearchRec); end;
);或则用于(NT)
BOOL GetFileAttributesEx( LPCTSTR lpFileName, // pointer to string that specifies a file or directory
GET_FILEEX_INFO_LEVELS fInfoLevelId, // value that specifies the type of attribute information to obtain
LPVOID lpFileInformation // pointer to buffer to receive attribute information
);
vSearchRec: TSearchRec;
begin
FindFirst('C:\temp.txt', faAnyFile, vSearchRec);
ShowMessage(DateTimeToStr(FileDateToDateTime(vSearchRec.Time)));
ShowMessage(IntToStr(vSearchRec.Size));
FindClose(vSearchRec);
end;