Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
无法在 C# 中使用 System.Io 检索文件的作者信息。我尝试了GetOwner()方法,而 ii 总是给出一个静态值。请帮助我在选项卡 下获取作者的信息。File PropertiesDetails
GetOwner()
File Properties
Details
如果要获取创建文件的用户,可以试试这个:
string userWhoCreatedTheFile = System.IO.File.GetAccessControl(@"your path").GetOwner(typeof(System.Security.Principal.NTAccount)).ToString();