Search code examples
c#fileiolast-modifieddatecreated

How to get File Created Date and Modified Date


I have an .NET EXE file . I want to find the file created date and modified date in C# application. Can do it through reflection or with IO stream?


Solution

  • You could use below code:

    DateTime creation = File.GetCreationTime(@"C:\test.txt");
    DateTime modification = File.GetLastWriteTime(@"C:\test.txt");