Frage

I need to (on user demand) run an admin process several times from my app. I would like for users to enter admin credentials only once - so I would have to somehow store the credentials.

However I heard it's not possible to do this because of the way that UAC is designed.

Any other suggestions?

War es hilfreich?

Lösung

You can not store admin credentials. Instead, run your admin process once, and leave it elevated and running in the background in case you need to do more things. You can communicate with it via NamedPipes or sockets.

For an example of how you could use WCF to communicate, there is a very simple example here: http://bloggingabout.net/blogs/dennis/archive/2007/04/20/wcf-simple-example.aspx

You should probably create the WCF ServiceHost on the admin process.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top