本文整理汇总了C#中Users.GetUserByUserNo方法的典型用法代码示例。如果您正苦于以下问题:C# Users.GetUserByUserNo方法的具体用法?C# Users.GetUserByUserNo怎么用?C# Users.GetUserByUserNo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Users
的用法示例。
在下文中一共展示了Users.GetUserByUserNo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnlogin_Click
protected void btnlogin_Click(object sender, EventArgs e)
{
Users user = new Users();
UserInfo userInfo = user.GetUserByUserNo(txtUserName.Text.Trim());
if (userInfo != null)
{
string pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(userInfo.USERNO + txtPassword.Text, FormsAuthPasswordFormat.MD5.ToString());
if (userInfo.USERPWD == pwd.ToLower())
{
Session["userid"] = userInfo.USERID.ToString();
Session["cityid"] = userInfo.CITYID.ToString();
FormsAuthentication.RedirectFromLoginPage(txtUserName.Text.Trim(), false);
Response.Redirect("./Admin/adminindex.aspx");
return;
}
}
lblErrorInfo.Text = "用户名或密码错误!";
lblErrorInfo.ForeColor = Color.Red;
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (Request["UserId"] != null && Request["Password"] != null)
{
Users user = new Users();
UserInfo userInfo = user.GetUserByUserNo(Request["UserId"].ToString());
if (userInfo != null)
{
string pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(userInfo.USERNO + Request["Password"].ToString(), FormsAuthPasswordFormat.MD5.ToString());
if (userInfo.USERPWD == pwd.ToLower())
{
Session["userid"] = userInfo.USERID.ToString();
Session["cityid"] = userInfo.CITYID.ToString();
FormsAuthentication.RedirectFromLoginPage(Request["UserId"].ToString(), false);
Response.Redirect("./Admin/adminindex.aspx");
return;
}
}
}
}