Asp.NETPersonnalBlogSystem/Admin/Default.aspx.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Configuration;
using System.Linq;
using Asp.NETPersonnalBlogSystem.BLL;

namespace Asp.NETPersonnalBlogSystem.Admin
{
    /// <summary>
    /// 后台首页
    /// 显示系统统计数据和最新信息
    /// </summary>
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    LoadStatistics();
                    LoadLatestArticles();
                    LoadPendingComments();
                    LoadSystemInfo();
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine("Admin Default加载失败: " + ex.Message);
                }
            }
        }

        /// <summary>
        /// 加载统计数据
        /// </summary>
        private void LoadStatistics()
        {
            try
            {
                ArticleService articleService = new ArticleService();
                CommentService commentService = new CommentService();
                UserService userService = new UserService();

                if (divArticleCount != null)
                {
                    divArticleCount.InnerText = articleService.GetArticleCount().ToString();
                }
                
                if (divCommentCount != null)
                {
                    divCommentCount.InnerText = commentService.GetCommentCount().ToString();
                }
                
                if (divUserCount != null)
                {
                    var users = userService.GetAllUsers();
                    divUserCount.InnerText = users != null ? users.Count.ToString() : "0";
                }

                if (divViewCount != null)
                {
后面还有 73 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。