下面资料是关于C# 获得目录创建时间的片段的代码。
using System;
using System.IO;
class DirectoryCreationTime
{
public static void Main()
{
string directoryString =
Directory.GetCurrentDirectory() + @"TestDir";
Directory.CreateDirectory (directoryString);
DateTime dateTime = Directory.GetCreationTime (directoryString);
Console.WriteLine("Creation time: {0}", dateTime);
Directory.Delete (directoryString);
}
}
原文地址:https://blog.51cto.com/14311845/2386968
时间: 2024-10-08 22:40:08