用API函数肯定可以: 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 );
摘要信息:VS_FIXEDFILEINFO *lpInfo;
DWORD dw;
DWORD dwSize = GetFileVersionInfoSize( szFile, &dw ); //szFile中存放你的文件名,包括路径LPVOID lpData = (LPVOID)new char[dwSize];
GetFileVersionInfo( szFile, 0, dwSize, lpData );UINT ui;
VerQueryValue( lpData, "\\", (LPVOID*)&lpInfo, &ui );//例如版本号
iVerMajor = HIWORD( lpInfo->dwFileVersionMS );
iVerMinor = LOWORD( lpInfo->dwFileVersionMS );
iVerBuildTimes = LOWORD( lpInfo->dwFileVersionLS );
//其它内容,可以参照msdn中的VerQueryValue取得...
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
);
FindNextFile()
FindClose()