全局静态变量:static bool ok=false;
先打开主窗体,在 OnLoad 的时候模式打开登录窗体
登录窗体中验证成功时,ok=true;
登录窗体返回后,检测 if(!ok) Close();