private static void Nurse(object sender, System.Timers.ElapsedEventArgs e) { try { Console.WriteLine("[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo) + "]" + "定时监测"); HttpHelperMin http = new HttpHelperMin(); var res = http.GetHtml(new HttpItemMin() { URL = "http://*****:*****@echo off\r\n" + "echo 更新中...\r\n" + "taskkill /f /im CardService.exe\r\n" + $"{ConfigurationManager.AppSettings["ExePath"].GetLeft(":")}:\r\n" + $"cd \"{ConfigurationManager.AppSettings["ExePath"]}\"\r\n" + "start \"\" CardService.exe\r\n"; //"del ReLoad.bat"; string path = AppDomain.CurrentDomain.BaseDirectory + "ReLoad.bat"; Console.WriteLine("[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo) + "]" + path); File.WriteAllText(path, com, Encoding.Default); System.Diagnostics.Process.Start(path); } } catch (Exception exception) { Console.WriteLine("[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo) + "]" + exception.Message); } }