实现效果:
知识运用:
DirectoryInfo类的CreationTion属性
public DataTime CreationTime {get; set;}
实现代码:
private void button1_Click(object sender, EventArgs e) { FolderBrowserDialog FBDialog = new FolderBrowserDialog(); if (FBDialog.ShowDialog() == DialogResult.OK) { string Path = FBDialog.SelectedPath; textBox1.Text = Path; label2.Text = "创建时间:" + (new DirectoryInfo(Path)).CreationTime; } }