Retreive file summary information using c#
Posted on 2004-09-21
I am looking for a way to retrieve summary information from a file. Such as "Title", "Subject", "Author", "Comments".
Moreover, the values you give to the attributes in the properties of the file when you right-click on it.
I am looking mainly for txt files and office documents.
I've got the following information without a problem using System.IO:
DirectoryInfo dirInfo = new DirectoryInfo(strRootPath);
DirectoryInfo dirs = dirInfo.GetDirectories();
int iNumOfFiles = dirInfo.GetFiles().Length;
FileInfo fInfo = new FileInfo[ iNumOfFiles ];
fInfo = dirInfo.GetFiles();
foreach(FileInfo fi in fInfo)
lblInfo.Text +=fi.Name+" "+fi.Size.... //which I am able to get some information about each file. But not exactly what i need!
Thanks for the help
My environment is: Visual Studio .Net 2003 (ASP.NET and C#)