net6:创建Membership对象数据源的代码

2021-06-29 06:05

阅读:719

标签:mem   controls   use   void   sum   get   com   art   let   

原文发布时间为:2008-07-30 —— 来源于本人的百度文章 [由搬家工具导入]

添加了一个db的类作为了对象数据源:

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;

///


/// db 的摘要说明
///

public class db
{
public db()
{
   //
   // TODO: 在此处添加构造函数逻辑
   //
}
    public static MembershipUserCollection GetAllUsers()
    {
        int a = Membership.GetAllUsers().Count;
        return Membership.GetAllUsers(0, 5, out a);
    }

    public static MembershipUser GetUser()
    {
        return Membership.GetUser();
    }

    public static MembershipUser GetUser(string UserName)
    {
        return Membership.GetUser(UserName);
    }

    public static void Update(string Comment, string Email, bool IsApproved)
    {
        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);
    }

}

net6:创建Membership对象数据源的代码

标签:mem   controls   use   void   sum   get   com   art   let   

原文地址:http://www.cnblogs.com/handboy/p/7141549.html


评论


亲,登录后才可以留言!