1. 程式人生 > >C#獲取檔案建立時間的程式碼

C#獲取檔案建立時間的程式碼

下面資料是關於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>");
}
}