infosum.ascx.cs
来自「基于Asp.net、MS sql sever 2000、C# 论坛系统源码」· CS 代码 · 共 70 行
CS
70 行
namespace Stella.Web.Controls
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
/// <summary>
/// InfoSum 的摘要说明。
/// </summary>
public class InfoSum : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.Label topicSum;
protected System.Web.UI.WebControls.Label artSum;
protected System.Web.UI.WebControls.Label hitSum;
protected System.Web.UI.WebControls.Label memberSum;
protected System.Web.UI.WebControls.HyperLink quit;
protected System.Web.UI.WebControls.Label viewSum;
protected System.Web.UI.WebControls.HyperLink lm;
protected System.Web.UI.WebControls.Label name;
private void Page_Load(object sender, System.EventArgs e)
{
setUp();
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器
/// 修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void setUp()
{
this.quit.Visible=this.Request.IsAuthenticated;
if(!this.Request.IsAuthenticated)
this.name.Text="你尚未登录. <a href=\"login.aspx\">登录</a> 或 <a href=\"register.aspx\">注册</a>";
else
this.name.Text="您好"+HttpContext.Current.User.Identity.Name;
Stella.Model.ForumInfoSum info=Stella.Model.ForumInfoSum.GetInstance();
this.topicSum.Text=info.TopicSum.ToString();
this.artSum.Text=info.ArtSum.ToString();
this.hitSum.Text=info.HitSum.ToString();
this.memberSum.Text=info.MemberSum.ToString();
this.viewSum.Text=info.ViewSum.ToString();
this.lm.Text=info.LastMember;
this.lm.NavigateUrl=string.Format("../pages/profile.aspx?mname={0}",info.LastMember);
this.lm.Target="_blank";
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?