Re: System.Diagnostic.Process and disfunctional process
From: Martin Dechev (detcheff__at_hotmail.com)
Date: 02/17/04
- Next message: Veke: "Re: Web Service Behaviour problem"
- Previous message: Andy Cortvriend: "storing problem"
- In reply to: Michael Johnson Sr.: "System.Diagnostic.Process and disfunctional process"
- Next in thread: Michael Johnson Sr.: "Re: System.Diagnostic.Process and disfunctional process"
- Reply: Michael Johnson Sr.: "Re: System.Diagnostic.Process and disfunctional process"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 17 Feb 2004 13:46:26 +0100
Hi, Michael Johnson Sr.,
I think you will still 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 (the last section in it):
[ 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 call "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-us/dllproc/base/openscmanager.asp
http://msdn.microsoft.com/library/en-us/dllproc/base/openservice.asp
http://msdn.microsoft.com/library/en-us/dllproc/base/startservice.asp
(optionally, if you need to further control the service, i.e. stop it:)
http://msdn.microsoft.com/library/en-us/dllproc/base/controlservice.asp
http://msdn.microsoft.com/library/en-us/dllproc/base/closeservicehandle.asp
Hope this helps
Martin
"Michael Johnson Sr." <m.johnson.sr@acmewidgets.com> wrote in message
news:e03$uCU9DHA.2316@TK2MSFTNGP09.phx.gbl...
> I am starting and stopping a process using System.Diagnostic.Process.
>
> aspnet_wp is running as system rather than machine (as per machine.config
> modification). When the process gets started, it will not respond to tcp
> connections. The process is a service that accepts incoming tcp
> connections.
>
> Any ideas will be great.
>
>
- Next message: Veke: "Re: Web Service Behaviour problem"
- Previous message: Andy Cortvriend: "storing problem"
- In reply to: Michael Johnson Sr.: "System.Diagnostic.Process and disfunctional process"
- Next in thread: Michael Johnson Sr.: "Re: System.Diagnostic.Process and disfunctional process"
- Reply: Michael Johnson Sr.: "Re: System.Diagnostic.Process and disfunctional process"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|