由于无法直接从远程服务器获取文件信息,所以可以发一个WebClient请求,在响应Headers可以得到修改时间,如果你需要文件版本的比对,你可以试试这种方法

1 Uri uri = new Uri(url, UriKind.Absolute);
2 WebClient request = new WebClient();
3 request.OpenReadAsync(uri);
4 request.OpenReadCompleted += (s, e) =>
5 {
6     string last = request.ResponseHeaders["Last-Modified"];
7 };

此方法同样适用于别的应用程序里,例如ASP.NET程序的WebClient可能不会是异步调用的,别的都一样的
 

相关文章:

  • 2021-06-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
相关资源
相似解决方案