Pluc
Pluc

Reputation: 2929

Tagging a file with a version number

I've developed a interop Excel application which generates various reports based on a copied template. The application has to be optimized to avoid useless routines such as updating a already up to date report.

There are 2 factors that creates the need of a very specific solution.

  1. The file may manually be modified in non-automated sections (Cannot use a file HASH or Modified date)
  2. I cannot afford to read inside the Excel sheet for a version number since the goal is to improve processing time by skipping files.

My idea was to use the file properties (Windows' right click properties) to add in a SQL row version or data hash.

However, so far, I haven't found a clean method to acheive this.

So the question is: Is there a .NET features or a highly supported / recommanded / maintained library to manage Windows' File Properties? If not, what alternative would you guys suggest?

Upvotes: 0

Views: 100

Answers (1)

Bob Vale
Bob Vale

Reputation: 18474

If the file is only ever going to stored on an NTFS volume then you can use an Alternate Data Stream.

There is a Library on Codeproject here that lets you use them from a .Net project

The only things you have to watch for is that the ADS don't survive being copied to a non NTFS volume and non ADS aware copy applications may not copy them

Upvotes: 1

Related Questions