static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //登录窗体判断 FormLogin flogin = new FormLogin(); flogin.ShowDialog(); if (flogin.DialogResult == DialogResult.OK) { MainForm mf = new MainForm(); Application.Run(mf); } }