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

时间:2021-06-23 05:54:21

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

我在PC上制作文件,我想将其传输到PPC(Windows Mobile)。

How can I get the modified date of this file?

如何获取此文件的修改日期?

(I need it on Windows Mobile.)

(我在Windows Mobile上需要它。)

3 个解决方案

#1


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

FileInfo.LastWriteTime和FileInfo.LastWriteTimeUtc应该注册此信息。

#2


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

Reference: File.GetLastWriteTime on MSDN.

参考:MSDN上的File.GetLastWriteTime。

#3


Try This.

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

#1


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

FileInfo.LastWriteTime和FileInfo.LastWriteTimeUtc应该注册此信息。

#2


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

Reference: File.GetLastWriteTime on MSDN.

参考:MSDN上的File.GetLastWriteTime。

#3


Try This.

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