As far as I am aware the code below appears to do what I intend it to do – although for some reason the deletest string does not appear to be set properly, as when I click on the button the action does not happen. Although if I define the actual task name e.g. “task3” it deletes it.
Code:
public string deletest {get;set;}
private void deletetask_Click(object sender, EventArgs e)
{
string deletetask = DeleteTaskBox.Text;
ScheduledTasks st = new ScheduledTasks(@"\\" + System.Environment.MachineName);
st.DeleteTask(deletest);
}
Different variable names.