本文整理汇总了C#中Utility.checkLoggin方法的典型用法代码示例。如果您正苦于以下问题:C# Utility.checkLoggin方法的具体用法?C# Utility.checkLoggin怎么用?C# Utility.checkLoggin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utility
的用法示例。
在下文中一共展示了Utility.checkLoggin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSignin_Click
protected void btnSignin_Click(object sender, ImageClickEventArgs e)
{
////assign session value
//Session["user"] = txtUser.Text;
////fill variable
//string user = Session["user"].ToString();
//if (txtUser.Text == "admin" || txtUser.Text == "school" || txtUser.Text == "parent")
//{
// Response.Redirect("~/Logged_Pages/Home.aspx");
//}
//-------------------------------------------------------
//create object Utility class
Utility utl = new Utility();
//get user level after compair passwords
string userLevel=utl.checkLoggin(txtUser.Text, txtPass.Text);
if (userLevel != "error")
{
//assign user level to the session
Session["userLevel"] = userLevel;
//assign session value
Session["user"] = txtUser.Text;
//go to Logged home page
Response.Redirect("~/Logged_Pages/Home.aspx");
}
}
示例2: btnChange_Click
protected void btnChange_Click(object sender, EventArgs e)
{
Utility utl = new Utility();
//get user level after compair passwords
string userLevel = utl.checkLoggin(Session["user"].ToString(), txtCurPas.Text);
if (userLevel != "error")
{
if (txtNewPass.Text == txtConfPass.Text)
{
//assigning encripted password form text box & Encript
Encriptor enc = new Encriptor();
string password = enc.encript(txtConfPass.Text.ToString());
//DB_Connect.InsertQuery("UPDATE users_mast SET USER_PASSWORD='" + password + "' WHERE USER_USERNAME='test'");
DB_Connect.InsertQuery("UPDATE users_mast SET USER_PASSWORD='" + password + "' WHERE USER_USERNAME='" + Session["user"].ToString() + "'");
lblstatus.Text = "Password Changed.";
}
else
{
lblstatus.Text = "Passwords Doesnt Match";
}
}
else
{
lblstatus.Text = "Current Password Invalid";
}
}