What is the difference between Owner and User (WindowsIdentity)?

余生颓废 提交于 2021-01-28 21:40:56

问题


When getting the username and/or SID of the current user, what is the preferred method?

Is it using:

WindowsIdentity.GetCurrent().Owner

Or:

WindowsIdentity.GetCurrent().User

What is the difference between the two? This would be a great question for SuperUser.com, but alas, it's not live yet. Thanks!


回答1:


What you usually want is the User.

Every security object in windows has permissions and owner. The user is also a security object so it has permissions and owner. The ownership means that the owner can change the permission on the user. And the permission (in case of the user object ) means things like delete the user, change group membership and such. And all of this is not intersting in most cases. So what you need is the 'User'.



来源:https://stackoverflow.com/questions/1027693/what-is-the-difference-between-owner-and-user-windowsidentity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!