用getfileattributes可以得到文件的属性,(是否隐藏,是否只读等属性)
用Getfiletime可以得到文件的时间。
然而,在XP下文件可以设置版本号等其他信息,不知道怎么读取?
在EXE中也有版本号信息,怎样读取?

解决方案 »

  1.   

    http://www.vckbase.com/code/listcode.asp?mclsid=15&sclsid=&page=5
     从可执行文件中读取版本信息 详细信息 < 文件操作(拷贝,查找,关联,信息) >  从可执行文件中读取版本信息源代码:VersionInfo_demo
    可以读取版本号、产品版本、文件版本、公司、版权信息等。[代码性质] VC完整应用程序代码
    [代码作者] 
    [文件大小] 36K 
    [更新日期] 2002-3-9 12:07:00 
    [下载次数] 5019  
      

  2.   

    用GetFileVersionInfo和GetFileVersionInfoSize这两个API可以得到版本号信息。GetFileVersionInfo
    The GetFileVersionInfo function retrieves version information for the specified file. BOOL GetFileVersionInfo(
      LPTSTR lptstrFilename,  // file name
      DWORD dwHandle,         // ignored
      DWORD dwLen,            // size of buffer
      LPVOID lpData           // version information buffer
    );GetFileVersionInfoSize
    The GetFileVersionInfoSize function determines whether the operating system can retrieve version information for a specified file. If version information is available, GetFileVersionInfoSize returns the size, in bytes, of that information. DWORD GetFileVersionInfoSize(
      LPTSTR lptstrFilename,  // file name
      LPDWORD lpdwHandle      // set to zero
    );
      

  3.   

    设置版本信息必须直接修改PE文件中的Version资源块,别无他法。
      

  4.   

    得到指定文件的公司名称,文件描述,内部名称,合法版权,原始文件名,产品名称,产品版本等一系列信息
    http://community.csdn.net/Expert/FAQ/FAQ_Index.asp?id=204828