private static DateTime ThisStartTime = DateTime.Now;      //本次启动时间
private static string AutoStartTime1 { get; set; }            //自动重启时间1
private static string AutoStartTime2 { get; set; }            //自动重启时间2
private static string AutoStartTime3 { get; set; }            //自动重启时间3
/*
此处自行补充获取AutoStartTime1、AutoStartTime2、AutoStartTime3三个值的代码
*/
private void timerResetAPP_Tick(object sender, EventArgs e)
{
    //判断是否需要自动重启本程序
    if (AutoStartTime1 != "" || AutoStartTime2 != "" || AutoStartTime3 != "")
    {
        DateTime temp_time;
        string thisDay = DateTime.Now.ToString("yyyy-MM-dd");
        TimeSpan ts_check_auto_start_1;
        TimeSpan ts_check_auto_start_2;
        int auto_start_flag = 0;
        if (AutoStartTime1 != "" && auto_start_flag == 0)
        {
            temp_time = Convert.ToDateTime($"{thisDay} {AutoStartTime1}:00");
            ts_check_auto_start_1 = DateTime.Now - temp_time;
            ts_check_auto_start_2 = temp_time - ThisStartTime;
            if (ts_check_auto_start_1.TotalSeconds > 0 && ts_check_auto_start_2.TotalSeconds > 0) { auto_start_flag = 1; }
        }
        if (AutoStartTime2 != "" && auto_start_flag == 0)
        {
            temp_time = Convert.ToDateTime($"{thisDay} {AutoStartTime2}:00");
            ts_check_auto_start_1 = DateTime.Now - temp_time;
            ts_check_auto_start_2 = temp_time - ThisStartTime;
            if (ts_check_auto_start_1.TotalSeconds > 0 && ts_check_auto_start_2.TotalSeconds > 0) { auto_start_flag = 1; }
        }
        if (AutoStartTime3 != "" && auto_start_flag == 0)
        {
            temp_time = Convert.ToDateTime($"{thisDay} {AutoStartTime3}:00");
            ts_check_auto_start_1 = DateTime.Now - temp_time;
            ts_check_auto_start_2 = temp_time - ThisStartTime;
            if (ts_check_auto_start_1.TotalSeconds > 0 && ts_check_auto_start_2.TotalSeconds > 0) { auto_start_flag = 1; }
        }
        //自动重启本程序
        if (auto_start_flag == 1) { resetAPP(); }
    }
}
private void resetAPP()
{
    //先隐藏本程序右下角图标(如果有右下角小图标,则需要加上这个隐藏小图标命令,否则不需要下面这行)
    notifyIcon.Visible = false;
    //获取并启动当前进程的可执行文件的完整路径
    StartProcess(Application.ExecutablePath);
    //彻底退出
    Thread.Sleep(100);     //为确保正确执行,延迟100毫秒退出
    Process.GetCurrentProcess().Kill();
    Environment.Exit(0);
}