1. The account ASP.NET runs under needs permissions to start/stop the =
service. Just add it to Admin group.
2. did you write the service "MyService" itself?
3. Why do you need to start/stop service from ASP.NET. The service =
usually starts automatically when windows starts.
George
[quoted text, click to view] "Andy" <-spam-andrzejjaworek@wp.pl> wrote in message =
news:dhk71r$otb$2@atlantis.news.tpi.pl...
Hello,
I would like to access to Windows Service via ASP.NET. I have written=20
very simple web application which starts and stops windows service. =
Here=20
is my StarButton event:
private void StartButton_Click(object sender, System.EventArgs e)
{
ServiceController sc =3D new ServiceController();
sc.ServiceName =3D "MyService";
sc.Start();
}
When I try to start Windows Service I receive the following error:
System.ComponentModel.Win32Exception: Access is denied.
How to set up my web application or my Windows Service to have a=20
perrmission to stoping or starting Windows Service via ASP.NET. I'm=20
newbie in Windows Services and I would ask You for help.
Thank You in advance.