简体   繁体   English

如何从Windows Mobile上的C#文件中获取修改日期?

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

I make a file in PC, and I want to transfer it to a PPC ( Windows Mobile ). 我在PC上制作文件,我想将其传输到PPCWindows Mobile )。

How can I get the modified date of this file? 如何获取此文件的修改日期?

(I need it on Windows Mobile.) (我在Windows Mobile上需要它。)

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

Reference: File.GetLastWriteTime on MSDN . 参考: MSDN上的 File.GetLastWriteTime

Try This. 试试这个。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM