Aquí está el código:
///Por cierto, las constantes son:/// Stops the SharePoint timer. /// public static void TimerStop() { ServiceController timerService = new ServiceController(Constants.SPTimerName); if (timerService.Status == ServiceControllerStatus.Running) { timerService.Stop(); timerService.WaitForStatus(ServiceControllerStatus.Stopped, Constants.WaitingTimeout); } } ////// Starts the SharePoint timer. /// public static void TimerStart() { ServiceController timerService = new ServiceController(Constants.SPTimerName); if (timerService.Status == ServiceControllerStatus.Stopped) { timerService.Start(); timerService.WaitForStatus(ServiceControllerStatus.Running, Constants.WaitingTimeout); } }
public static TimeSpan WaitingTimeout = new TimeSpan(0, 1, 30); public static string SPTimerName = "SharePoint 2010 Timer";
No hay comentarios:
Publicar un comentario