Hi,
I'm looking to find out a way of seeing when a file was last modified in C#. I have full access to the file.
Thanks in advance
Hi,
I'm looking to find out a way of seeing when a file was last modified in C#. I have full access to the file.
Thanks in advance
Just use File.GetLastWriteTime. There's a sample on that page showing how to use it.
You simply want the File.GetLastWriteTime
static method.
Example:
DateTime lastModified = System.IO.File.GetLastWriteTime("C:\foo.bar");
Console.WriteLine(lastModified.ToString("dd/MM/yy HH:mm:ss"));