To Start and stop service in axapta by code You first add reference System.Service Process in Application Object tree (AOT) on reference node.
Write the following code in job.
System.ServiceProcess.ServiceController ServiceController1 = new
System.ServiceProcess.ServiceController();
;
ServiceController1.set_MachineName(‘.’);
ServiceController1.set_ServiceName("IISADMIN");
ServiceController1.Stop();
sleep(500);
ServiceController1.Start();
Write the following code in job.
System.ServiceProcess.ServiceController ServiceController1 = new
System.ServiceProcess.ServiceController();
;
ServiceController1.set_MachineName(‘.’);
ServiceController1.set_ServiceName("IISADMIN");
ServiceController1.Stop();
sleep(500);
ServiceController1.Start();
No comments:
Post a Comment