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.

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,950 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 82,646 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.

    No comments