How do I check whether a user is allowed to read / write a particular registry key?

前端 未结 6 547
清歌不尽
清歌不尽 2020-12-31 08:14

Does anybody know how I can programmatically check (using C#) whether my program will be able to read / write a particular registry key (specifically: \"SOFTWARE\\Microsoft\

6条回答
  •  被撕碎了的回忆
    2020-12-31 09:16

    I'm not sure how to it with C#, but with Win32, you would use RegGetKeySecurity(). Maybe there's a C# wrapper? Otherwise, use P/Invoke.

提交回复
热议问题