示例#1
0
        /// <summary>
        /// 登录
        /// </summary>
        public static void Login()
        {
            LoginOn = new Login();
            LoginOn.Location = new Point(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width / 2, (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height - LoginOn.Height) / 2);

            DialogResult r = LoginOn.ShowDialog();
            if (r != DialogResult.Yes)
            {
                LoginOn.Close();
                ConsoleHelper.Flag = false;
                Menu.MenuItems[2].Text = "登录";
            }
            else
            {
                NotifyIconImg.ShowBalloonTip(5000, "迈尔后台数据服务", "用户已经登录,可以查看服务器详细内容", ToolTipIcon.None);
                ConsoleHelper.Username = "******";
                Menu.MenuItems[2].Text = "注销";
            }
        }
示例#2
0
 /// <summary>
 /// 静态构造方法
 /// </summary>
 static ConsoleHelper()
 {
     Username = string.Empty;
     IconPath = Path.Combine(Application.StartupPath, @"database.ico");
     LoginOn = new Login();
 }