?? user.cs
字號:
?using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
/// <summary>
/// user 的摘要說明
/// </summary>
namespace sms
{
public class user
{
private DataAccess DataAs;
public user()
{
}
public bool Login(string UserID, string UserPwd)
{
DataAs = new DataAccess();
DataTable dt = DataAs.CreateDatatable("select 1 from [users] where User_id ='" + UserID + "' and User_password ='" + UserPwd+"'");
if (dt.Rows.Count > 0)
{
dt.Dispose();
return true;
}
else
{
dt.Dispose();
return false;
}
}
public OleDbDataReader GetUser(string UserID, string UserPwd)
{
DataAs = new DataAccess();
string strSql = "select User_id,User_password,User_power from [users] where User_id ='" + UserID + "' and User_password ='" + UserPwd + "'";
OleDbDataReader dr = DataAs.GetDatareader(strSql);
return dr;
}
public bool UpdateUserPwd(string UserID, string UserPwd)
{
DataAs = new DataAccess();
bool Result = DataAs.ExecSql("update [users] set User_password ='" + UserPwd + "' where User_id ='" + UserID + "'");
return Result;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -