Example #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            textBox3.Text = "";
            string[] content = lws.login(textBox1.Text, textBox2.Text).Split(',');
            switch (content[0])
            {
            case "link_fail":
                textBox3.Text = "连接不上服务器";
                break;

            case "login_repeat":
                textBox3.Text = "请勿重复登录";
                break;

            case "login_nonexistent":
                textBox3.Text = "用户不存在";
                break;

            case "login_incorrect":
                textBox3.Text = "密码错误";
                break;

            case "login_success":
                me = new User(content);
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                break;

            default:
                textBox3.Text = "UNKnown Error";
                break;
            }
        }
Example #2
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBox1.SelectedIndex == 0)
     {
         if (lws.Quit == true)
         {
             string msg = lws.login(user.id, user.password);
             if (msg.Split(',')[0] != "login_success")
             {
                 comboBox1.SelectedIndex = 1;
             }
             else
             {
                 lws.start(user);
             }
         }
     }
     else
     {
         close();
     }
 }