GetLastWriteTime () returns a DateTime object, so you can do this:
if (File.GetLastWriteTime(filename).CompareTo(File.GetLastWriteTime(filename2)) == 0)
to check if they have the same timestamp.
For more information on comparing DateTime objects, see.
source share