ShowMessage.aspx.cs
资源名称:mcr.rar [点击查看]
上传用户:balance_rz
上传日期:2020-04-18
资源大小:103k
文件大小:1k
源码类别:
SCSI/ASPI
开发平台:
Others
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Web;
- using System.Web.SessionState;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.HtmlControls;
- using MyChatRoom.BusinessLogicLayer;
- namespace MyChatRoom.WebLayer
- {
- /// <summary>
- /// ShowMessage 的摘要说明。
- /// </summary>
- public partial class ShowMessage : System.Web.UI.Page
- {
- protected void Page_Load(object sender, System.EventArgs e)
- {
- InitData();
- }
- /// <summary>
- /// 初始化留言数据,显示时间最近的10条留言信息
- /// </summary>
- private void InitData()
- {
- //加载最近的10条留言
- DataSet ds=Message.LoadTop10();
- //逐条显示
- if(ds!=null)
- {
- foreach(DataRow dr in ds.Tables[0].Rows)
- {
- Response.Write("<font color="+dr["Color"].ToString()+">"); //颜色
- Response.Write(dr["CreateTime"].ToString()); //发言时间
- Response.Write("【"+dr["UserName"].ToString()+"】"); //发言用户
- Response.Write(dr["Emotion"].ToString()); //表情
- Response.Write("说道:");
- Response.Write(dr["Content"].ToString()); //发言内容
- Response.Write("</font><br>");
- }
- }
- }
- }
- }