0

I would like to create a function that gets a specific property called 'Article Number'. This function is recursivly called for each file in a list. It is used in an executable application built in C#, and I'm unable to register dll's like DSOFile because the executable will be placed on a server, where anyone could run it. Using Shell to get all properties (GetDetailsOf) feels like overkill, because I only need that one property. The function might be called 500 times (because it's used for multiple files). If the property doesn't exist, the function can return "";

The files are Solid Edge files (a 3D-cad program that works with files like asm, psm, par). Extended file properties are used to store custom properties of these files (like supplier, finish, etc.). We use a property called 'Article Number' to store our own ID of this object. When looking at a file's properties, a tab called 'Custom' (see attached) is visible, even when Solid Edge isn't installed. Here we can view these properties. I would like to know how to get this information through code.

How do I get a specific extended property value called 'Article Number' from a filename?

Image of the 'Custom' Tab in the file properties

Image of the 'Custom' Tab in the file properties

Community
  • 1
  • 1
Jan Willem
  • 122
  • 11

1 Answers1

0

I am 1 rep till comments, so dont take this as answer.

You are talking about specific property of file, but in the end you refer that this "Article Number" is located at filename?

Can you provide some examples what you have and what you need?

Tomáš Filip
  • 727
  • 3
  • 6
  • 23
  • I added extra information. I want to create a function that takes the filename as an argument, and returns the value stored in the property 'Article Number', or "" (empty) when 'Article Number' doesn't exist. – Jan Willem Oct 05 '18 at 09:18
  • Check this https://stackoverflow.com/questions/220097/read-write-extended-file-properties-c . There are stated some nuget packages which should do it. – Tomáš Filip Oct 05 '18 at 09:20
  • I have added the nuget packages (I had some trouble with the framework, but setting it to 4.6 helpt installing). Now I'm able to call the ShellFile.FromFilePath(filename), but don't know how to proceed now. – Jan Willem Oct 05 '18 at 11:59