Example #1
0
 void ucLogin1_UserLoginValidating(object arg1, UserLoginEventArgs arg2)
 {
     if (arg2.LoginId == "admin" && arg2.LoginPassword == "8888")
     {
         arg2.IsOk = true;    //在这个地方不知道为什么"LoginId == "admin"、LoginPassword == "888888""而跳过本行代码,导致结果运行错误!
     }
     else
     {
         arg2.IsOk = false;
     }
 }
Example #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     //在这里执行用户的校验
     if (UserLoginValidating != null)
     {
         UserLoginEventArgs evtObj = new UserLoginEventArgs();
         evtObj.IsOk          = false;
         evtObj.LoginId       = txtUid.Text.Trim();
         evtObj.LoginPassword = txtPwd.Text.Trim();
         UserLoginValidating(this, evtObj);
         if (evtObj.IsOk)
         {
             this.BackColor = Color.Green;
         }
         else
         {
             this.BackColor = Color.Red;
         }
     }
 }