net6:创建Membership对象数据源的代码
2021-06-29 06:05
标签:mem controls use void sum get com art let 原文发布时间为:2008-07-30 —— 来源于本人的百度文章 [由搬家工具导入] 添加了一个db的类作为了对象数据源: using System; /// public static MembershipUser GetUser() public static MembershipUser GetUser(string UserName) public static void Update(string Comment, string Email, bool IsApproved) } net6:创建Membership对象数据源的代码 标签:mem controls use void sum get com art let 原文地址:http://www.cnblogs.com/handboy/p/7141549.html
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;
/// db 的摘要说明
///
public class db
{
public db()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public static MembershipUserCollection GetAllUsers()
{
int a = Membership.GetAllUsers().Count;
return Membership.GetAllUsers(0, 5, out a);
}
{
return Membership.GetUser();
}
{
return Membership.GetUser(UserName);
}
{
MembershipUser mu = Membership.GetUser();
mu.Comment = Comment;
mu.Email = Email;
Membership.UpdateUser(mu);
}
public static void UpdateAll(string UserName,bool IsLockedOut,string Comment, string Email)
{
MembershipUser mu = Membership.GetUser(UserName);
mu.Comment = Comment;
mu.Email = Email;
if (IsLockedOut = false)
{
mu.UnlockUser();
}
Membership.UpdateUser(mu);
}
public static void Delete(string UserName)
{
Membership.DeleteUser(UserName);
}