2

I'd like to know how to get the file author using C#, Not the file owner but the file Author, because when searching I find just how to get the file owner.

I already try this:

 string user = System.IO.File.GetAccessControl(file).GetOwner(typeof(System.Security.Principal.NTAccount)).ToString();

But this get the file owner.

Kamel
  • 243
  • 2
  • 17
  • 4
    And how would you define the file Author? – Mark Jansen Aug 11 '15 at 14:03
  • 2
    Maybe this can help: http://stackoverflow.com/questions/220097/read-write-extended-file-properties-c/2096315#2096315? – SmartDev Aug 11 '15 at 14:03
  • 3
    Files don't have authors. – SLaks Aug 11 '15 at 14:04
  • 1
    @SLaks - some have that property. have a look at the properties of a word file – fubo Aug 11 '15 at 14:05
  • 1
    Are you talking of things such as word/office documents? so in there there is a property of author I believe, or, any file, in which case you can only go by creator or last updated user. – BugFinder Aug 11 '15 at 14:07
  • 1
    @fubo Yes, but it's not part of the file system. You actually have to open the file, parse it and read the author. It's just one of the complicated things Explorer makes look easy :) – Luaan Aug 11 '15 at 14:07
  • @MarkJansen when selecting a file, in the bottom there is some properties of the file (name, title, authors, lastmodified, .....) – Kamel Aug 11 '15 at 14:11

0 Answers0