I'm trying to make an app that displays all authors of .doc files from a Folder and its subfolders, the problem is that I used Directory.GetFiles("*.doc", SearchOption.AllDirectories)
and when I'm trying to read from a folder with very much files, the app freeze in this point.
Here is my code
FileInfo[] Files = dir.GetFiles("*.doc", SearchOption.AllDirectories);
foreach(FileInfo file in Files)
{
try
{
//ConvertDOCToDOCX(file.FullName);
using(WordprocessingDocument sourcePresentationDocument = WordprocessingDocument.Open(file.FullName, false))
{
metadataList.Add(new Metadata()
{
Name = "Title", Value = file.Name
});
metadataList.Add(new Metadata()
{
Name = "Author", Value = sourcePresentationDocument.PackageProperties.Creator
});
metadataList.Add(new Metadata()
{
Name = "", Value = ""
});
}
}
}