This C# Program Gets File Time using File Class. Here the File creation time is found using the date time class.
Here is source code of the C# Program to Get File Time using File Class. The C# program is successfully compiled and executed with Microsoft Visual Studio. The program output is also shown below.
/*
* C# Program to Get File Time using File Class
*/
using System;
using System.IO;
class Program
{
static void Main()
{
FileInfo info = new FileInfo("C:\\srip.txt");
DateTime time = info.CreationTime;
Console.WriteLine("File was Created at : ");
Console.Write(time);
Console.Read();
}
}
Here is the output of the C# Program:
File was Created at : 9/30/2013 12:15:44 PM
Sanfoundry Global Education & Learning Series – 1000 C# Programs.
advertisement
advertisement
If you wish to look at all C# Programming examples, go to 1000 C# Programs.
Next Steps:
- Get Free Certificate of Merit in C# Programming
- Participate in C# Programming Certification Contest
- Become a Top Ranker in C# Programming
- Take C# Programming Tests
- Chapterwise Practice Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Chapterwise Mock Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Related Posts:
- Practice Computer Science MCQs
- Practice MCA MCQs
- Buy MCA Books
- Buy Computer Science Books
- Apply for C# Internship