namespace AsiaINFO.SMS.APPCMPP2 { using Common; using System; using System.Diagnostics; using System.Windows.Forms; internal static class Program { [STAThread] private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { SetEnv.SetEnvironmentVariable("NLS_LANG", "American_America.US7ASCII"); Application.Run(new MainForm()); } catch (Exception exception) { WorkLog.AddMsg("严重错误日志", exception.Message); } finally { string[] strArray = Process.GetCurrentProcess().MainModule.FileName.Split(new char[] { '\\' }); RunCmd("taskkill /im " + strArray[strArray.Length - 1] + " /f "); } } public static string RunCmd(string command) { Process process = new Process { StartInfo = { FileName = "cmd.exe", Arguments = "/c " + command, UseShellExecute = false, RedirectStandardInput = true, RedirectStandardOutput = true, RedirectStandardError = true, CreateNoWindow = true } }; process.Start(); return process.StandardOutput.ReadToEnd(); } } }