I need to write a C# program that executes operations requiring elevated privileges, but also has a UI that a limited-rights user can interact with (to initiate the privileged operations and see the results of those operations). How can I achieve this?
Asked
Active
Viewed 180 times
1 Answers
1
You have a zillion alternatives. I'd consider:
1) use a Windows service to handle the "operations requiring elevated privileges",
2) write a small, simple WinForms app for your UI, and
3) Use Windows "named pipes" to communicate between your client and service
Here's a tutorial:
http://tech.pro/tutorial/855/wcf-tutorial-basic-interprocess-communication

FoggyDay
- 11,962
- 4
- 34
- 48
-
1I would re-word #3 slightly *"Use WCF over Windows Named Pipes to communicate between your client and service"*. Using raw Named Pipes to go between privileged and non privileged processes [can be a PITA](http://stackoverflow.com/questions/3478166/named-pipe-server-throws-unauthorizedaccessexception-when-creating-a-seccond-ins). Letting WCF handle the pipe management over a `net.pipe` channel (which is what the tutorial you linked to does) makes it a LOT easier. – Scott Chamberlain Jun 03 '14 at 03:59