对于上下文,我正在尝试创建类似于Windows Parental Control的东西
这就是我现在想要做的。
到目前为止,我设法得到了这个https://i.imgur.com/s1NtJbQ.png
TimeSpan span = dateEndTime.Value.Subtract(dateStartTime.Value);
timeInMinutes = Convert.ToInt32(span.TotalMinutes);
MessageBox.Show(Convert.ToString(timeInMinutes));
if(comboWeekdays.SelectedItem == null)
{
return;
}
selectedWeekday = comboWeekdays.SelectedItem.ToString();
MessageBox.Show(selectedWeekday);
System.Threading.Timer newTimer = new System.Threading.Timer(LogOff, null, (timeInMinutes * 60000), (timeInMinutes * 60000));
chartTimeTable.Series.Clear();
chartTimeTable.Series.Add("Monday");
chartTimeTable.Series.Add("Tuesday");
chartTimeTable.Series.Add("Wednesday");
chartTimeTable.Series.Add("Thursday");
chartTimeTable.Series.Add("Friday");
chartTimeTable.Series.Add("Saturday");
chartTimeTable.Series.Add("Sunday");