I\'m writing some code to utilise a 3rd party component, and I need to supply an object which implements ICredentials when I start to use it.
If I write the following...
Unfortunately you have to interop with the WMI like this:
http://www.codeproject.com/Articles/28161/Using-WMI-to-manipulate-services-Install-Uninstall
The value you're looking to query for is StartName, which will evaluate to something like "NT Authority\NetworkService" (or whatever you're using). If you mash up the second part of this article with the first part getting it should be pretty straightforward.