Unable to retrieve Author's information of a file using System.Io in C#.
I tried with GetOwner()
method and ii is always gives a static value.
Kindly help me to get the Author's information under the File Properties
which are under Details
Tab.
Asked
Active
Viewed 237 times
-1

LopDev
- 823
- 10
- 26
-
Hi and welcome to Stackoverflow. Please read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example). – rekcul Jul 01 '20 at 07:11
-
Can you show us a piece of code? In this way we can see where you're stuck. – Francesco Jul 01 '20 at 07:18
1 Answers
0
If you want to get the user who created a file, you can try this:
string userWhoCreatedTheFile = System.IO.File.GetAccessControl(@"your path").GetOwner(typeof(System.Security.Principal.NTAccount)).ToString();

Buda Gavril
- 21,409
- 40
- 127
- 196