コード例 #1
0
ファイル: PianoLogin.cs プロジェクト: James-cgf/Piano
 /// <summary>
 /// 点击GO按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Go_Click(object sender, EventArgs e)
 {
     this.Go.Cursor = Cursors.AppStarting;
     if (RememberCB.Checked)
     {
         WriteIP.writeIdAndPwd(tbId.Text, tbPwd.Text);
     }
     else
     {
         if (System.IO.File.Exists(idPath))
         {
             System.IO.File.Delete(idPath);
         }
         if (System.IO.File.Exists(passwordPath))
         {
             System.IO.File.Delete(passwordPath);
         }
     }
     if (loginOrLogon)
     {
         if (EmailIsMath.emailIsMath(tbEmail.Text, "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(.[a-zA-Z0-9-]+)*.[a-zA-Z0-9]{2,6}$"))
         {
             //为了不对主线程造成阻塞
             new System.Threading.Thread(sw).Start();
         }
         else
         {
             MessageBox.Show("邮箱格式不正确", "", MessageBoxButtons.OK, MessageBoxIcon.None);
         }
     }
     else
     {
         try {
             this.id = Convert.ToInt32(tbId.Text);
         } catch {
             MessageBox.Show("亲,请使用注册时返回的ID进行登录哦~~", "登录异常");
         }
         //为了不对主线程造成阻塞
         new System.Threading.Thread(sw).Start();
     }
     this.Go.Cursor = Cursors.Default;
 }
コード例 #2
0
 private static Process process = ProcessStart.processStart("PianoLoad\\PianoLoad.exe"); //打开等待页面
 /// <summary>
 /// 静态代码块
 /// </summary>
 static PianoMain()
 {
     try {
         //屏幕分辨率
         IniWindowsSize windowsSize = new IniWindowsSize();
         if (!windowsSize.windowsSize(1920, 1080))
         {
             new OpenWarning().ShowDialog();
             exit = true;
             MessageBox.Show("当前分辨率:" + windowsSize.getX() + "px*" + windowsSize.getY() + "px\r\n点击退出", "分辨率不一致", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         string id_      = WriteIP.getId();
         string password = WriteIP.getPassword();
         if (id_ != null && password != null)
         {
             id        = Convert.ToInt32(id_);
             LoginInfo = true;
         }
         //初始登录方法
         MIDDLEENUM MIDDLEENUM = new LogonMiddle().unscrambleSigninToLogin(id, password, ref NickName, ref logonTime, ref LoginInfo);
     } catch {
     }
 }