Windows需要更新“修改的文件”时间戳? [英] What's required for Windows to update the "file modified" timestamp?

查看:565
本文介绍了Windows需要更新“修改的文件”时间戳?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显然它获取一个写入操作期间更新,但是否有任何非破坏性的操作也强制更新?基本上希望能够做的* nix的触摸命令相同,但在C#编程。

Obviously it gets updated during a write operation, but are there any non-destructive operations that also force an update? Basically looking to be able to do the equivalent of the *nix touch command, but in C# programmatically.

推荐答案

使用功能SetFileTime (C ++)或File.SetLastWriteTime(C#)到最后一个写时间设置为当前时间。

Use the function SetFileTime (C++) or File.SetLastWriteTime (C#) to set the last write time to the current time.

这篇关于Windows需要更新“修改的文件”时间戳?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆