⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 security.aspx.cs

📁 asp销售管理系统
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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;

public partial class Security_security : System.Web.Administration.SecurityPage
{

    public void Page_Load()
    {
        if (!IsPostBack)
        {
            UpdateProviderUI();
        }
    }

    private void UpdateProviderUI()
    {
        try
        {
            int total = 0;
            MembershipUserCollection users = (MembershipUserCollection)Membership.GetAllUsers();
            string[] roles = null;
            try
            {
                roles = Roles.GetAllRoles();
            }
            catch
            {
                // will throw if roles not enabled
            }

            userCount.Text = users.Count.ToString();
            if (roles != null)
            {
                roleCount.Text = roles.Length.ToString();
            }
            else
            {
                roleCount.Text = "0";
            }
            roleCount.Visible = true;
            waLink5.Visible = true;
        }
        catch (Exception e)
        {
            Response.Write("有错误发生,请服务器管理员。");
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -