c# - Application freezes when trying to read Author from .doc multiple files -


i'm trying make app displays authors of .doc files folder , subfolders, problem used directory.getfiles("*.doc", searchoption.alldirectories) , when i'm trying read folder files, app freeze in point. here 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 = ""             });         }     } } 

i think dont need "wordprocessingdocument" - producing heavy load - can read meta-information via .net default file methods.

for example, should take @ read/write 'extended' file properties (c#)


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -