Get file creation time in c#

מפתחת תכנה 1 Reputation point
2021-11-09T08:16:10.227+00:00

I have my own tackles of pictures that change but with the same names.
When I want to get the time to create the file it gives me the creation time of the first even though a lot of pictures have already been replaced under the same name.
For example, an image under the name 333.png was replaced after a minute to another image under the same name 333.png
He's probably keeping history on the image by its name. How do I erase that history? so I can get the creation time of the current file.

Developer technologies C#
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 122.5K Reputation points
    2021-11-09T08:50:59.22+00:00

    Maybe use "Last Write Time" instead of creation time. Or, if the files are replaced by your program, you can change the creation time programmatically using FileInfo class.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.