简体   繁体   English

使用WinHttp函数检索HTTP文件的时间戳

[英]Retrieve time-stamp of HTTP file using WinHttp function

How to get the time stamp of a file, that can be downloaded from HTTP server, using HTTP protocol? 如何获取可以使用HTTP协议从HTTP服务器下载的文件的时间戳? I am particularly interested in WinHttp functions , but any HTTP reference will do. 我对WinHttp函数特别感兴趣,但是任何HTTP参考都可以。

There is a time-stamp field in response-header, but that refers the time when the HTTP server responded , and not the file-time of the file. response-header中有一个时间戳字段,但这是HTTP服务器响应的时间,而不是文件的文件时间。

To retrieve the creation/modified date-time of a file received over HTTP, there exists a field Last-Modified within the HTTP response header. 要检索通过HTTP接收的文件的创建/修改日期时间,HTTP响应标头中存在一个字段Last-Modified

As the documentation says: 如文档所述:

The Last-Modified entity-header field indicates the date and time at which the origin server believes the variant was last modified [...] The exact meaning of this header field depends on the implementation of the origin server and the nature of the original resource. [...] Last-Modified实体标头字段指示原始服务器认为该变体最后被修改的日期和时间。此标头字段的确切含义取决于原始服务器的实现和原始属性资源。 For files, it may be just the file system last-modified time 对于文件,可能只是文件系统的上次修改时间

WinHttp function to retrieve the header info is WinHttpQueryHeaders . 检索标头信息的WinHttp函数是WinHttpQueryHeaders

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM