0

When you right click on a file in a folder in your PC, and go to properties in the dropdown menu, a dialog box pops up. One of the tabs on that box is details.

Is there a way to access those details in code? I've tried using files, directories, FileInfo, FileVersionInfo and I can't seem to figure out how to, and even if they are accessible. I am uploading images from a local repository folder and need some of those details to add as metadata in the blob for storage in Azure Storage.

var info = FileVersionInfo.GetVersionInfo(@"C:\\mypath\\GE_StrengthenedFrame.JPG");

that does not produce any methods to access properties, for example an image will have properties such as Camera and Image and sub properties to those main properties.

dinotom
  • 4,990
  • 16
  • 71
  • 139
  • Show what you have tried...FileInfo and FileVersionInfo give you most of what you need. Which part are you missing? – Rufus L Apr 24 '17 at 17:07
  • Some info is in FileInfo but type specific data must be read either from other sources like properties of the Image once you have loaded it: in addition to the dimensions and resolution there are PropertyItems and/or Exif data, if they are present. See [here](http://stackoverflow.com/questions/37789372/c-sharp-add-edit-and-delete-tags-of-file/37844828#37844828) for a discussion. For easiest access you may want to seach for a library, but, please not here.. – TaW Apr 24 '17 at 17:08
  • @Rufus...see updated OP – dinotom Apr 24 '17 at 17:16
  • 1
    Meta data is harder to get from c#. I assume you are looking for the data you see when you hover over the Windows Explorer. See posting : http://stackoverflow.com/questions/37869388/how-to-read-extended-file-properties-file-metadata – jdweng Apr 24 '17 at 17:52
  • @jdweng...looks good. Ill test that out later – dinotom Apr 24 '17 at 18:13
  • 1
    You probably should be asking about image metadata instead of filesystem data. If you think in those terms you will find articles like [How to: Read Image Metadata](https://msdn.microsoft.com/en-us/library/xddt0dz7(v=vs.110).aspx). – Sam Hobbs Apr 24 '17 at 18:40
  • I used an image file as an example, I need the details for all kinds of files – dinotom Apr 24 '17 at 19:33

0 Answers0