本文介绍了本地化的组名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过分配权限的Everyone组配置互斥访问规则。当我创建我的规则,它看起来像下面这样

I want to configure a Mutex access rule by assigning privileges to the "Everyone" group. When I create my rule it looks something like the following

new MutexAccessRule("Everyone", MutexRights.Modify | MutexRights.Synchronize | MutexRights.TakeOwnership | MutexRights.ReadPermissions, AccessControlType.Allow)

如何获得本地化的Everyone组名称,以便这将工作在操作系统的非英语版本。

How do I get the localized "Everyone" group name so this will work on a non english version of the OS.

感谢

推荐答案

而不是使用组名称,使用底层的SID,这是不本地化。

Rather than using the group name, use the underlying SID, which is not localised.

var rule = new MutexAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null),
                               MutexRights.Modify
                                | MutexRights.Synchronize 
                                | MutexRights.TakeOwnership
                                | MutexRights.ReadPermissions,
                               AccessControlType.Allow)

这篇关于本地化的组名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 03:50