Beispiel #1
0
        /// <summary>
        /// 线程里运行
        /// </summary>
        /// <param name="cmd"></param>
        /// <param name="filePath"></param>
        /// <param name="backUp"></param>
        /// <param name="logsfolder"></param>
        private void ThreadRun(string cmd, string filePath, Models.BackUp backUp, string logsfolder)
        {
            FilePath   = filePath;
            Cmd        = cmd;
            LogsFolder = logsfolder;
            BackUp     = backUp;
            bool isSuccess = false;

            fm_Loading           = new Fm_Loading();
            IsExceing            = true;
            tsslStatus.Text      = $@"状态:正在{logsfolder}...";
            tsslStatus.ForeColor = Color.Black;

            fm_Loading = new Fm_Loading();
            Thread th = new Thread(new ThreadStart(RunCmd));

            th.Start();

            IsExceing            = false;
            isSuccess            = fm_Loading.ShowDialog() == DialogResult.OK;
            tsslStatus.Text      = isSuccess ? $@"状态:{logsfolder}成功" : $@"状态:{logsfolder}失败";
            tsslStatus.ForeColor = isSuccess ? Color.Green : Color.Red;
            if (isSuccess && BackUp.Type != Models.BackType.导入)
            {
                EmailTitle = $"Oracle数据库{logsfolder}:{BackUp.Username}";
                EmailBody  = Newtonsoft.Json.JsonConvert.SerializeObject(BackUp);
                Thread thA = new Thread(new ThreadStart(SendMail));
                thA.Start();
            }
        }
Beispiel #2
0
 public Fm_Main()
 {
     InitializeComponent();
     fm_Loading = new Fm_Loading();
     Status     = Class.Json.GetStatus();
     AllRunTime = Status.AllRunTime;
     StartTime  = DateTime.Now;
     timer.Start();
     timerBackUp.Start();
 }