码迷,mamicode.com
首页 > Windows程序 > 详细

C#获取文件创建时间的代码

时间:2019-01-13 01:47:32      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:朋友   应该   tco   upper   创建   tin   source   com   创建时间   

下面资料是关于C#获取文件创建时间的内容,应该是对各朋友也有用处。
using System;
using System.IO;
class Class1 {
static void Main(string[] args) {
string[] cla = Environment.GetCommandLineArgs();
if (cla.GetUpperBound(0) == 2) {
FileInfo fi = new FileInfo(cla[1]);
fi.MoveTo(cla[2]);
Console.WriteLine("File Created : " + fi.CreationTime.ToString());
Console.WriteLine("Moved to : " + cla[2]);
} else
Console.WriteLine("Usage: mv <source file> <destination file>");
}
}

C#获取文件创建时间的代码

标签:朋友   应该   tco   upper   创建   tin   source   com   创建时间   

原文地址:http://blog.51cto.com/14143192/2342046

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!