Find out File Owner/Creator in C# [duplicate]
-
21-01-2021 - |
Question
Possible Duplicate:
Getting / setting file owner in C#
I searched the Internet but didn't found out how to get the File Creator/Owner In the FileInfo Class are only other Attributes like lastAccessTime, Size, but not the Owner/Creator.
Does somebody know the answer?
Solution
string user = System.IO.File.GetAccessControl(path).GetOwner(typeof(System.Security.Principal.NTAccount)).ToString();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow