使用CInternetSession,完成下载后,文件的修改日期发生改变了,变成的当前日期,(和源文件的日期不同),如何才能保持和源文件修改日期相同?????

解决方案 »

  1.   

    SetFileTime
    The SetFileTime function sets the date and time that a file was created, last accessed, or last modified. BOOL SetFileTime(
      HANDLE hFile,                     // handle to file
      CONST FILETIME *lpCreationTime,   // creation time
      CONST FILETIME *lpLastAccessTime, // last-access time
      CONST FILETIME *lpLastWriteTime   // last-write time
    );
    Parameters
    hFile 
    [in] Handle to the file for which to set the dates and times. The file handle must have been created with GENERIC_WRITE access to the file. 
    lpCreationTime 
    [in] Pointer to a FILETIME structure that contains the date and time the file was created. This parameter can be NULL if the application does not need to set this information. 
    lpLastAccessTime 
    [in] Pointer to a FILETIME structure that contains the date and time the file was last accessed. The last access time includes the last time the file was written to, read from, or (in the case of executable files) run. This parameter can be NULL if the application does not need to set this information. 
    lpLastWriteTime 
    [in] Pointer to a FILETIME structure that contains the date and time the file was last written to. This parameter can be NULL if the application does not want to set this information. 
      

  2.   

    谢谢stevecrisewu(月亮骑士)的热心帮助,
    但是我下载http://www.111.com/1.mp3时,无法取到此文件在服务器上的修改时间呀???请再帮帮我。。
      

  3.   

    ftp服务提供的下载可以保持原来的文件时间。
    http的不行。
    可以自己写个程序批量改文件的创建 修改时间,也有下载的。
      

  4.   

    但是FLASHGET下载的文件是和源文件修改时间一致的。也是http的。