所有者和用户(WindowsIdentity)有什么区别? [英] What is the difference between Owner and User (WindowsIdentity)?

查看:109
本文介绍了所有者和用户(WindowsIdentity)有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

获取当前用户的用户名和/或SID时,首选方法是什么?

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

使用它吗?

WindowsIdentity.GetCurrent().Owner

或者:

WindowsIdentity.GetCurrent().User

两者之间有什么区别?对于SuperUser.com,这将是一个很大的问题,但是可惜,它还没有发布.谢谢!

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

推荐答案

您通常想要的是用户.

Windows中的每个安全对象都具有权限和所有者.用户也是安全对象,因此它具有权限和所有者.所有权意味着所有者可以更改对用户的许可.权限(在用户对象的情况下)意味着诸如删除用户,更改组成员身份之类的事情.在大多数情况下,所有这些都不是相互干扰的.因此,您需要的是用户".

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'.

这篇关于所有者和用户(WindowsIdentity)有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆