如何获取文件创建日期和修改日期 [英] How to get File Created Date and Modified Date

查看:171
本文介绍了如何获取文件创建日期和修改日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.NET EXE文件。
我想在C#应用程序中找到文件创建日期和修改日期。你可以使用下面的代码:
$可以通过反射或IO流做到这一点吗?

解决方案

b $ b

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


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?

解决方案

You could use below code:

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

这篇关于如何获取文件创建日期和修改日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆