开发者

How to get the IdentityReference for "Everyone" to create MutexAccessRule on localized systems?

开发者 https://www.devze.com 2023-02-02 14:46 出处:网络
I\'d like to use the code as in this question or this question to create a system wide Mutex. This works fine on most systems, but on a German XP installation I get the error that \"Some or all identi

I'd like to use the code as in this question or this question to create a system wide Mutex.

This works fine on most systems, but on a German XP installation I get the error that "Some or all identity references could not be translated". The problem is that the group "Everyone" 开发者_运维百科is called "Alle" on this system.

So how do I get the correct IdentityReference to create a MutexAccessRule for "Everone" or "Users" on all systems independent of the OS language?


Just found the solution by continuing searching. See the answer to this question here:

new SecurityIdentifier(WellKnownSidType.WorldSid, null)

This can be used rather than "Everyone".

Can someone mark this question here as duplicate if found correct?

0

精彩评论

暂无评论...
验证码 换一张
取 消