C#获取文件创建时间的方法
本文实例讲述了C#获取文件创建时间的方法。分享给大家供大家参考。具体如下:
C#获取文件创建时间,主要用到了FileInfo的CreattionTime属性
usingSystem;
usingSystem.IO;
classClass1{
staticvoidMain(string[]args){
string[]cla=Environment.GetCommandLineArgs();
if(cla.GetUpperBound(0)==2){
FileInfofi=newFileInfo(cla[1]);
fi.MoveTo(cla[2]);
Console.WriteLine("FileCreated:"+fi.CreationTime.ToString());
Console.WriteLine("Movedto:"+cla[2]);
}else
Console.WriteLine("Usage:mv<sourcefile><destinationfile>");
}
}
希望本文所述对大家的C#程序设计有所帮助。
热门推荐
10 佛学生日简短祝福语
11 家庭聚餐的简短祝福语
12 感恩老师祝福语简短独特
13 用名字做祝福语简短
14 中秋送礼的祝福语简短
15 元旦感恩祝福语简短大全
16 晚安幽默祝福语简短
17 简短深沉的生日祝福语
18 小朋友六一祝福语简短