UAC elevated, run some not-elevated code
I am running an elevated UAC app. At one point in code, I want to create a file that is available for not-elevated apps. However, I cannot achieve to do this while ele开发者_开发知识库vated.
Is it possible to run just some lines not elevated (or is there a better solution for this)
Thanks in forward
How about modifying file security(ACL) to allow access by EveryOne (or All Users based on your need) - see System.Security.AccessControl.FileSecurity - check the example at down to understand how to modify ACL for file. You can generate identity ref for EveryOne using something like new SecurityIdentifier(WellKnownSidType.WorldSid, null)
.
精彩评论