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


C# User.CheckPass方法代码示例

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


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

示例1: Adduser

    public int Adduser(string UserName, string Password, string FirstName, string LastName, int Age, string City, string Email, string imageUrl)
    {
        User U1 = new User();
        U1.UserName = UserName;
        U1.UserPassword = Password;
        U1.Fname = FirstName;
        U1.Lname = LastName;
        U1.Age = Age;
        U1.City = City;
        if (Email=="undefined")
        {
            Email = FirstName + LastName + "[email protected]";
        }
        U1.Email = Email;
        U1.ImageUrl = imageUrl;

        int numEfect = U1.InsertNewUser();
        DataTable dt = U1.CheckPass();
        if (dt.Rows.Count != 0)
        {
            if (dt.Rows[0]["UserPassword"].ToString() == U1.UserPassword)
            {
                HttpContext.Current.Session["Fname"] = dt.Rows[0]["Fname"].ToString();
                HttpContext.Current.Session["UserDeatail"] = dt;
                HttpContext.Current.Session["UserId"] = dt.Rows[0]["UserId"].ToString();
            }
        }
        return numEfect;
    }
开发者ID:nategot,项目名称:Benny,代码行数:29,代码来源:WebService.cs

示例2: LoginBTN_Load

    protected void LoginBTN_Load(object sender, EventArgs e)
    {
        User u = new User();
        u.UserPassword = Password.Text;
        u.Email = Email.Text;
        DataTable dt = u.CheckPass();
        if (dt.Rows.Count != 0)
        {
            if (dt.Rows[0]["UserPassword"].ToString() == u.UserPassword)
            {
                HttpContext.Current.Session["Fname"] = dt.Rows[0]["Fname"].ToString();
                HttpContext.Current.Session["UserDeatail"] = dt;
                Response.Redirect("Default.aspx");

            }

        }

        AnsLogInLBL.Text = "Worng Password or Email";
    }
开发者ID:nategot,项目名称:Benny,代码行数:20,代码来源:Login.aspx.cs

示例3: AdduserMobile

    public string AdduserMobile(string UserName, string Password, string FirstName, string LastName, int Age, string City, string Email, string imageUrl)
    {
        User U1 = new User();
        U1.UserName = UserName;
        U1.UserPassword = Password;
        U1.Fname = FirstName;
        U1.Lname = LastName;
        U1.Age = Age;
        U1.City = City;
        U1.Email = Email;
        U1.ImageUrl = imageUrl;
        JavaScriptSerializer js = new JavaScriptSerializer();
        string jsonString = js.Serialize("Wrong Email or Password ");

        int numEfect = U1.InsertNewUser();
        DataTable dtt = U1.CheckPass();
        try
        {
            if (dtt.Rows.Count != 0)
            {

                User u = new User();
                u.Fname = dtt.Rows[0]["Fname"].ToString();
                u.Email = dtt.Rows[0]["Email"].ToString();
                u.ImageUrl = dtt.Rows[0]["Picture"].ToString();
                u.UserName = dtt.Rows[0]["UserName"].ToString();
                u.UserId = int.Parse(dtt.Rows[0]["UserId"].ToString());
                jsonString = js.Serialize(u);

            }
        }
        catch (Exception ex)
        {
            jsonString = js.Serialize("Error in: " + ex.Message);
        }
        return jsonString;
    }
开发者ID:nategot,项目名称:Benny,代码行数:37,代码来源:WebService.cs

示例4: Login

    public string Login(string Email, string Password)
    {
        User u = new User();
        u.UserPassword = Password;
        u.Email = Email;
        JavaScriptSerializer js = new JavaScriptSerializer();
        string jsonString = js.Serialize("Worng Email or Password ");
        try
        {
            DataTable dt = u.CheckPass();
            if (dt.Rows.Count != 0)
            {
                if (dt.Rows[0]["UserPassword"].ToString() == u.UserPassword)
                { jsonString = js.Serialize("ok"); }
            }

        }
        catch (Exception ex)
        {
            jsonString = js.Serialize("error in treasure.Login --- " + ex.Message);
        }
        return jsonString;
    }
开发者ID:nategot,项目名称:Benny,代码行数:23,代码来源:WebService.cs


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