How do I get modified date from file in C# on Windows Mobile?

C#DatetimeWindows Mobile

C# Problem Overview


I make a file in PC, and I want to transfer it to a PPC (Windows Mobile).

How can I get the modified date of this file?

(I need it on Windows Mobile.)

C# Solutions


Solution 1 - C#

FileInfo.LastWriteTime and FileInfo.LastWriteTimeUtc should register this information.

Solution 2 - C#

string strFilePath = @"C:\myfile.txt";
DateTime lastModified = System.IO.File.GetLastWriteTime(strFilePath);

Reference: File.GetLastWriteTime on MSDN.

Solution 3 - C#

Try This.

FileInfo fileInfo = new FileInfo("path");
var created = fileInfo.CreationTime; //File Creation
var lastmodified = fileInfo.LastWriteTime;//File Modification

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGoldView Question on Stackoverflow
Solution 1 - C#Steve GuidiView Answer on Stackoverflow
Solution 2 - C#vapcguyView Answer on Stackoverflow
Solution 3 - C#raghu sathvaraView Answer on Stackoverflow