Hi, jzink,
I posted this yesterday to a similar topic:
I think you will need to impersonate a user that has rights to
start/stop services on the machine (I'm afraid I can't give you the list of
these rights)
Have a look at the following article:
[ Implementing Impersonation in an ASP.NET Application ]
http://support.microsoft.com/default.aspx?kbid=306158
After doing so, you have 2 ways
- using the System.Diagnostics.Process to start "net.exe" and passing it the
appropriate parameters. It's simpler, but not the better way for sure.
- using platform-invoke - you will have to call the following functions:
http://msdn.microsoft.com/library/en...nscmanager.asp http://msdn.microsoft.com/library/en...penservice.asp http://msdn.microsoft.com/library/en...artservice.asp
(optionally, if you need to further control the service, i.e. stop it:)
http://msdn.microsoft.com/library/en...rolservice.asp http://msdn.microsoft.com/library/en...vicehandle.asp
Hope this helps
Martin
"jzink" <an*******@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.com...
I need to create a asp.net page that will have the ability to start and
stop and windows service that we have created. Is there an api or something
that I can use to interact with windows services ?