File Properties using C#
File Name of your file:
When reviewing or opening a file, to get its name, the FileInfo class is equipped with the Name property. Here is an sample code:
FileInfo oFileInfo = new FileInfo(strFilename);
MessageBox.Show("My File's Name: \"" + oFileInfo.Name + "\"");
Date and Time a File Created
The Operating System takes care to keep track of the date and time of a file was created. To find out what those date and time values are, you can access the File System Information property using.
DateTime dtCreationTime = oFileInfo.CreationTime;
MessageBox.Show("Date and Time File Created: " + dtCreationTime.ToString());
Find your file extension:
When you access a file or when the user opens one, to know the extension of the file, you can access the value of the FileSystemInfo.Extension property.
MessageBox.Show("myFile Extension: " + oFileInfo.Extension);
Find file size using C#:
One of the routine operations the operating system performs consistly for all the file is calculating the size of files it holds.
MessageBox.Show("myFile total Size: " + oFileInfo.Length.ToString());