Mann Maurya

Mann Maurya

  • NA
  • 104
  • 9.7k

Is there any way to run publish file as administrator.

Nov 30 2017 5:18 AM
I have develope a window service , To start and stop the service i am using folowing
code:- 
 
public void StartService(string serviceName)
{
ServiceController service = new ServiceController(serviceName);
try
{
service.Stop();
Thread.Sleep(500);
service.Start();
Thread.Sleep(1500);
}
catch { }
}
 
When I use this code Running my visual studio as administrator it works fine .
  
but the code is not working on iis , Is there any way to open an iis application as administrator ,
 
For grammer Mistake Sorry.
 
Please Help, Thank you!
 
 

Answers (4)