Previous Thread:   Datagrid not refreshing with new data

9/30/2005 4:41:11 PM    Re: ASP.NET + WindowsServices




9/30/2005 10:27:17 PM    ASP.NET + WindowsServices
Hello,  
  
I would like to access to Windows Service via ASP.NET. I have written  
  
very simple web application which starts and stops windows service. Here  
  
is my StarButton event:  
  
private void StartButton_Click(object sender, System.EventArgs e)  
  
{  
  
ServiceController sc = new ServiceController();  
  
sc.ServiceName = "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  
  
perrmission to stoping or starting Windows Service via ASP.NET. I'm  
  
newbie in Windows Services and I would ask You for help.  
  
Thank You in advance.  
  
Andy

9/30/2005 10:46:40 PM    Re: ASP.NET + WindowsServices
Andy,  
  
Well, for starting/stopping services you'll need the Administrator  
  
rights. Haven't tried it myself but hey, it are the organs of your  
  
Windows OS ;)  
  
Cheers,  
  
//Rutger  
  
http://www.RutgerSmit.com  
  
Andy wrote:

9/30/2005 10:47:27 PM    Re: ASP.NET + WindowsServices
George wrote:  
  
Yes.  
  
I will write in the future the specific web application that will  
  
controll one of the windows services

9/30/2005 10:50:30 PM    Re: ASP.NET + WindowsServices
George wrote:  
  
There isn't the other solution ? I don't want that ASPNET runs under  
  
Admin permission. It may be dengerous.