|
API examples for newer versions
Please visit the latest API Examples documentation to view API examples for newer versions of Kentico.
|
The following example creates a web farm synchronization task.
private void CreateTask()
{
// Set the properties
string taskTarget = "";
string taskTextData = "MyWebFarmTask";
byte[] taskBinaryData = null;
WebFarmTaskTypeEnum webfarmTaskType = WebFarmTaskTypeEnum.ClearHashtables;
// Create the web farm task
WebSyncHelperClass.CreateTask(webfarmTaskType, taskTarget, taskTextData, taskBinaryData);
}
|
The following example runs all tasks assigned to the current server (the one specified in the web.config file).
private void RunMyTasks()
{
WebSyncHelper.ProcessMyTasks();
}
|