private static void Main() { try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (StatusChecking()) { var tinyRadiusService = new TinyRadiusService(); var mainFomr = new MainForm { TinyRadiusService = tinyRadiusService }; Application.Run(mainFomr); } } catch (Exception ex) { var log = LogManager.GetLogger(typeof(Program)); log.Error("Application Error", ex); MessageBox.Show("程序运行出错,请联络管理员"); Application.Exit(); } }