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 http://taskscheduler.codeplex.com/discussions
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?
Thanks