当前位置: 首页>>代码示例>>C#>>正文


C# User.CheckUser方法代码示例

本文整理汇总了C#中User.CheckUser方法的典型用法代码示例。如果您正苦于以下问题:C# User.CheckUser方法的具体用法?C# User.CheckUser怎么用?C# User.CheckUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在User的用法示例。


在下文中一共展示了User.CheckUser方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            string empId = textBox1.Text;
            string password = textBox2.Text;

            User aOldUser = new User(empId, password);
            User findUser = aOldUser.GetUserInformation(empId);

            bool login = aOldUser.CheckUser(aOldUser);
            if (login)
            {
                string newPw1 = textBox3.Text;
                string newPw2 = textBox4.Text;
                if (newPw1==newPw2)
                {
                    User aNewUser = new User(empId,newPw1,findUser.UserType);
                    aNewUser.UpdateInformation(aOldUser,aNewUser);
                    MessageBox.Show("Password updated");
                    this.Close();
                    fmLogin.f.Show();
                }
                else
                {
                    MessageBox.Show("The two passwords do not match.");
                }

            }
        }
开发者ID:mrmontreal,项目名称:works,代码行数:28,代码来源:ChangeUserPassword.cs

示例2: btnLogin_Click

        private void btnLogin_Click(object sender, EventArgs e)
        {
            string empId = txtUserName.Text;
            string password = txtUserPwd.Text;

            User aUser = new User(empId, password);
            bool login = aUser.CheckUser(aUser);
            if (login)
            {
                typeNumber = aUser.GetType(aUser);
                FormMain aForm = new GUI.Main.FormMain(typeNumber);
                aForm.Show();
                this.Hide();
            }
        }
开发者ID:mrmontreal,项目名称:works,代码行数:15,代码来源:fmLogin.cs

示例3: RegisterUser

    public void RegisterUser()
    {
        if (CheckPage())
        {
            User UserObj = new User();
            UserObj.Email = txtEmail.Text;
            UserObj.Password = txtPwd.Text;
            UserObj.Image = USER_INIT_PATH;
            if (!UserObj.CheckUser())
            {
                if (UserObj.RegUser())
                {
                    //userInfo uInfo = new userInfo();
                    //uInfo.UserId = UserObj.UserId;
                    //uInfo.UserName = getUserName(UserObj.Email);
                    //Session.Add("_di09USR", uInfo);

                    //Response.Redirect("~/home.aspx", true);

                    LoginCls LogObj = new LoginCls(UserObj.Email, UserObj.GetPassword);
                    switch (LogObj.CheckLogin("user"))
                    {
                        case users.Anonymous:
                            ShowMessage(Message.Error, "Invalid Username Or Password.");
                            break;
                        case users.User:
                            Session.Add("_di09USR", LogObj.UInfo);
                            Response.Redirect(LogObj.ProfilePage, true);
                            break;
                        default:
                            break;
                    }
                }
                else
                {
                    ShowMessage(Message.Error, "Unable To Register.");
                }
            }
            else
            {
                ShowMessage(Message.Warning, "Email Already Exists.");
            }
        }
        else
        {
            ShowMessage(Message.Error, "Fill all fields.");
        }
    }
开发者ID:Neerajgithub,项目名称:iChat,代码行数:48,代码来源:register.aspx.cs

示例4: Login

    public int Login(string email_id, string password)
    {
        User u = new User();
           bool result= u.CheckUser(email_id, password);
           if (result)
           {
          string status= u.CheckStatus(email_id);
          if (status == "Admin")
              return 10;
          else
              return 1;

           }
           else
           return 0;
    }
开发者ID:njain006,项目名称:CodeSense,代码行数:16,代码来源:UserBLL.cs

示例5: UserRegister

    public int UserRegister(string emailid, string pasword, string fname, string lname, string cotry, DateTime date, string status,string image)
    {
        User a = new User(emailid, pasword, fname, lname, cotry, date, status,image);

        bool result=a.CheckUser(emailid);
        if (result == true)
        {
           int i= a.AddUser(pasword, emailid, fname, lname, cotry, date, status, image);
           if (i > 0)
               return 1;
           else
               return 0;

        }

        else
        {

            return -1;

        }
    }
开发者ID:njain006,项目名称:CodeSense,代码行数:22,代码来源:UserBLL.cs


注:本文中的User.CheckUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。