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

末鹿安然 提交于 2020-01-18 15:50:40

问题


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.)


回答1:


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




回答2:


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

Reference: File.GetLastWriteTime on MSDN.




回答3:


Try This.

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


来源:https://stackoverflow.com/questions/1185378/how-do-i-get-modified-date-from-file-in-c-sharp-on-windows-mobile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!