zoukankan      html  css  js  c++  java
  • net6:创建Membership对象数据源的代码

    原文发布时间为: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;

    /// <summary>
    /// db 的摘要说明
    /// </summary>
    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);
        }

    }

  • 相关阅读:
    10 个迅速提升你 Git 水平的提示
    GitLab-CI与GitLab-Runner
    WEB应用安全解决方案测试验证
    sparse representation 与sparse coding 的区别的观点
    The Ph.D. Grind
    Potential Pythonic Pitfalls
    Overfitting & Regularization
    LVM的一般操作过程
    你跟大牛之间仅仅差一个google
    Hadoop伪分布式模式部署
  • 原文地址:https://www.cnblogs.com/handboy/p/7141549.html
Copyright © 2011-2022 走看看