Help with Task Scheduler Managed Wrapper RRS feed

  • Question

  • Hi, i have created a form in VS2012 with textboxes to enter starttime (as 00:00) , user, office and a datetimepicker to set a startdateof the scheduled task.

    I am using the  Task Scheduler Managed Wrapper from

    I have a couple of issues with setting the task

    I have this:

    dateTimePicker1.Format = DateTimePickerFormat.Custom;

    dateTimePicker1.CustomFormat = "yyyy, MM, dd"; string startdate = dateTimePicker1.Text;

    string username = TB_username.Text;

    string newsitecode = TB_newsitecode.Text;

    Can i pass this into the timetrigger? I would like to set the task with text values provided by the starttime and by the datetimepicker

    taskdDef.Triggers.Add(new TimeTrigger(new DateTime(2012, 12, 31)));

    I tried as 
    taskdDef.Triggers.Add(new TimeTrigger(new DateTime stardate)));
    but it doesn't work.

    Also if i try to use  2 arguments on 
    taskdDef.Actions.Add(new ExecAction("c:\task.exe", "-user" + user + @" -office " + office));

    but the arguments are created as:

    System.Windows.Forms.TextBox, Text: user

    I know i need to use user.Text to remove this but it stilll doesn't work, any ideas?


    • Moved by Mike Feng Thursday, March 14, 2013 9:55 AM
    Friday, March 8, 2013 11:17 AM

All replies

  • Hi slowscripter,

    Does timetrigger comes from the Task Scheduler Managed Wrapper?

    I'm afraid that is not a WinForms component and it is not supported here.

    Thanks for your understanding and support.

    Best regards,

    Chester Hong
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, March 12, 2013 7:38 AM