Need web service to start the process
Hi,I need the Asp.Net web service to start any process(for example: web service to start the calculator using calc.exe)that need to be run in the windows server 2008...
string locn = ConfigurationManager.AppSettings["EXELOC"];
Process myProcess = new Process();
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.FileName = locn + "DoComplexTask.exe";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();
public static void StartService(string serviceName, int timeoutMilliseconds)
{
ServiceController service = new ServiceController(serviceName);
try
{
TimeSpan timeout = TimeSpan.FromMilliseconds(timeoutMilliseconds);
service.Start();
service.WaitForStatus(ServiceControllerStatus.Running, timeout);
}
catch
{
// ...
}
}