开发者

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).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜