开发者

C#.NET Getting File Replaced Time

开发者 https://www.devze.com 2023-03-06 20:45 出处:网络
When we upload files from browser if there\'s a file with same name开发者_如何学C in directory, it\'ll overwrite the existing one.

When we upload files from browser if there's a file with same name开发者_如何学C in directory, it'll overwrite the existing one.

Is there any way (any property) I can check the last replace time for the file...?

Any suggesting will be greatly appreciated.

Thanks n Regard, Aki


Are you just asking for the modified timestamp on the file, like this?

class Program
{
    static void Main(string[] args)
    {
        FileInfo fileInfo = new FileInfo("C:\\foo.txt");
        Console.WriteLine(fileInfo.LastWriteTimeUtc);
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号