ZennoLab Assemblies Documentation
AddTask Method (ZennoPoster)
Example 

Type: System.String

The new task to add in xml format.

Add a new task.
Syntax
public static void AddTask( 
   string task
)

Parameters

task

Type: System.String

The new task to add in xml format.

Example
The following example shows call the AddTask method.
// Create a task in xml format
var task =
@"<Id>{guid}</Id>
<Name>{name}</Name>
<CreateTime>{date DD.MM.YYYY hh:mm:ss}</CreateTime>
<ExecutionSettings>    
    <LimitOfThreads>1</LimitOfThreads>
    <MaxAllowOfThreads>0</MaxAllowOfThreads>
    <DoneSuccesfully>0</DoneSuccesfully>
    <DoneAll>0</DoneAll>
    <NumberOfTries>0</NumberOfTries>
    <LastNumberOfTries>0</LastNumberOfTries>
    <Priority>50</Priority>
    <Proxy>{DoNotUseProxy, IfPossible, UseProxyWithoutRemove, UseProxy}</Proxy>
    <Status>Newbie</Status>
    <ProxyLabels></ProxyLabels>
    <ShouldBeExecutedRandomly>{True, False}</ShouldBeExecutedRandomly>
    <GroupLabels>Без метки</GroupLabels>
    <GroupStates>Выполнены</GroupStates>
    <MaxNumOfSuccesStop>-1</MaxNumOfSuccesStop>
    <MaxNumOfFailStop>-1</MaxNumOfFailStop>
    <NumOfFailStop>0</NumOfFailStop>
</ExecutionSettings>
<SchedulerSettings>
    <StartDate>{date DD.MM.YYYY hh:mm:ss}</StartDate>
    <EndDate>{date DD.MM.YYYY hh:mm:ss}</EndDate>
    <RepetitionCount>1</RepetitionCount>
    <ScheduleType>{EveryMinutes, EveryDays, EveryWorkDays}</ScheduleType>
    <RepeatType>{WithoutEnd, FinishAfter, FinishByDate}</RepeatType>
    <ActivateTime>{date DD.MM.YYYY hh:mm:ss}</ActivateTime>
    <ActivateWorkTime>{date DD.MM.YYYY hh:mm:ss}</ActivateWorkTime>
    <IsActive>{True, False}</IsActive>
    <NumberOfTries>0</NumberOfTries>
    <Minutes>1</Minutes>
    <Days>1</Days>
    <LastScheduleDate>{date DD.MM.YYYY hh:mm:ss}</LastScheduleDate>
    <IsClearSucces>{True, False}</IsClearSucces>
</SchedulerSettings>
<Project>
    <ProjectFileLocation>{path}</ProjectFileLocation>
    <ProjectType>Assembly</ProjectType>
</Project>";
// Add the task
ZennoPoster.AddTask(task);
// Create a task in xml format
$task =
@"<Id>{guid}</Id>
<Name>{name}</Name>
<CreateTime>{date DD.MM.YYYY hh:mm:ss}</CreateTime>
<ExecutionSettings>    
    <LimitOfThreads>1</LimitOfThreads>
    <MaxAllowOfThreads>0</MaxAllowOfThreads>
    <DoneSuccesfully>0</DoneSuccesfully>
    <DoneAll>0</DoneAll>
    <NumberOfTries>0</NumberOfTries>
    <LastNumberOfTries>0</LastNumberOfTries>
    <Priority>50</Priority>
    <Proxy>{DoNotUseProxy, IfPossible, UseProxyWithoutRemove, UseProxy}</Proxy>
    <Status>Newbie</Status>
    <ProxyLabels></ProxyLabels>
    <ShouldBeExecutedRandomly>{True, False}</ShouldBeExecutedRandomly>
    <GroupLabels>Без метки</GroupLabels>
    <GroupStates>Выполнены</GroupStates>
    <MaxNumOfSuccesStop>-1</MaxNumOfSuccesStop>
    <MaxNumOfFailStop>-1</MaxNumOfFailStop>
    <NumOfFailStop>0</NumOfFailStop>
</ExecutionSettings>
<SchedulerSettings>
    <StartDate>{date DD.MM.YYYY hh:mm:ss}</StartDate>
    <EndDate>{date DD.MM.YYYY hh:mm:ss}</EndDate>
    <RepetitionCount>1</RepetitionCount>
    <ScheduleType>{EveryMinutes, EveryDays, EveryWorkDays}</ScheduleType>
    <RepeatType>{WithoutEnd, FinishAfter, FinishByDate}</RepeatType>
    <ActivateTime>{date DD.MM.YYYY hh:mm:ss}</ActivateTime>
    <ActivateWorkTime>{date DD.MM.YYYY hh:mm:ss}</ActivateWorkTime>
    <IsActive>{True, False}</IsActive>
    <NumberOfTries>0</NumberOfTries>
    <Minutes>1</Minutes>
    <Days>1</Days>
    <LastScheduleDate>{date DD.MM.YYYY hh:mm:ss}</LastScheduleDate>
    <IsClearSucces>{True, False}</IsClearSucces>
</SchedulerSettings>
<Project>
    <ProjectFileLocation>{path}</ProjectFileLocation>
    <ProjectType>Assembly</ProjectType>
</Project>";
// Add the task
ZennoPoster::AddTask($task);
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

ZennoPoster Class
ZennoPoster Members

Send Feedback