When you click the Button that opens the .rtf files in the RichTextBox , the date you created this file in the Label should appear, how to do this?

 private void buttonOpen_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Rich Text Format | *.rtf"; if (ofd.ShowDialog() == DialogResult.OK) { richTextBox1.LoadFile(ofd.FileName); } else { } } 

    1 answer 1

     label1.Text=System.IO.File.GetCreationTime(ofd.FileName).ToString();