using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
/// <summary>
///UserServer 的摘要说明
/// </summary>
public class UserServer
{
public UserServer()
{
//
//TODO: 在此处添加构造函数逻辑
//
}
public static Member GetuserByUserName(string username)
{
string sql = "select * from users where username = @username";
using (SqlDataReader reader = DBHelper.GetReader(sql,new SqlParameter("@username",username)))
{
if (reader.Read())
{
Member member = new Member();
member.Username = (string)reader["username"];
member.Password = (string)reader["password"];
reader.Close();
return member;
}
else
{
reader.Close();
return null;
}
}
}
}