开发者

C#.NET Getting File Replaced Time

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜