Posts Tagged ‘Schedule’

How to : Execute Timer Jobs Programmatically »

using(SPSite site = new SPSite("http://portal")) { foreach(SPJobDefinition job in site.WebApplication.JobDefinitions) { if(job.Name == "Workflow Auto Cleanup") { job.Execute(new Guid("C9CBB265-FB94-497f-8AC0-E99CDFBC4F52")); } } } 来源: http://www.evrenayan.net/post/How-to-Execute-Timer-Jobs-Programmatically.aspx