예제 #1
0
        private static void Restart(string reason)
        {
            BeforeRestarting?.Invoke();
            Log.Info($"Restart by '{reason}'");
            Log.Close();

            using (Process p = new Process())
            {
                p.StartInfo = new ProcessStartInfo(
                    Process.GetCurrentProcess().
                    MainModule.FileName);
                p.Start();
            };
            Application.Exit();
        }
예제 #2
0
        private static void Restart(string reason)
        {
            BeforeRestarting?.Invoke();
            Log.Info($"Restart by '{reason}'");
            Log.Close();

            using (Process p = new Process())
            {
                p.StartInfo = new ProcessStartInfo(
                    Process.GetCurrentProcess().
                    MainModule.FileName);
                try
                {
                    p.Start();
                }
                catch (Win32Exception ex)
                {
                    Log.Warn("Restart failed", ex);
                }
            }

            Application.Exit();
        }