[C#]取得檔案的修改跟建立日期

如上

參考

c# - How to get File Created Date and Modified Date - Stack Overflow

 

  private void button1_Click(object sender, EventArgs e)
        {
            //https://stackoverflow.com/questions/23243336/how-to-get-file-created-date-and-modified-date           

            string[] mFiles =   Directory.GetFiles(@"D:\20220816\");
            foreach (string f in mFiles)
            {
                DateTime creation = File.GetCreationTime(f);
                DateTime modification = File.GetLastWriteTime(f);
                MessageBox.Show(modification.ToString());
               
            }
            
        }

以上文章僅用紀錄資料使用.....