本文整理汇总了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;
}
示例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";
}
示例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;
}
示例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;
}