获取文件夹的创建时间

实现效果:

  

知识运用:

  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;
            }
        }

猜你喜欢

转载自www.cnblogs.com/feiyucha/p/10236058.html
今日推荐