Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
342 views
in Technique[技术] by (71.8m points)

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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...