Finding the user who modified the shared drive folder files

你。 提交于 2019-11-30 16:28:20

I have got the fix to that, It can be achieved using the ObjectSecurity Class of .NET. In that we can use the GetOwner. It fetches the owner of the file who has modified / created a file. This is the piece of code which would help:

string owner = System.IO.File.GetAccessControl(e.FullPath).GetOwner(typeof(System.Security.Principal.NTAccount)).ToString();
Console.WriteLine(owner);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!