SimpleChat/MsgList.cs

(开头部分) 2KB

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

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;
//该源码下载自www.51aspx.com(51aspx.com)

namespace SimpleChat
{
    public class MsgList
    {
        int msgNum = 8;
        public int msgNowID;

        MsgStructure [] messageList; 
        public MsgList()
        {
            msgNowID = 0;
            messageList = new MsgStructure[msgNum];
        }
        public void MsgPush(string msg)
        {
            msgNowID++;
            MsgStructure tmpMsg = new MsgStructure(msgNowID, msg);
            for(int i=0;i<msgNum-1;i++)
            {
                messageList[i] = messageList[i + 1];
            }
            messageList[msgNum - 1] = tmpMsg;
        }
        public string[] GetMsg(int nowID)
        {
            int tmpCount = msgNowID - nowID;
            string[] tmpStr;
            if (tmpCount > 0)
            {
                tmpStr = new string[tmpCount];
                int tmpBig = tmpCount>=8?8:tmpCount;
                for(int i=0;i<tmpBig;i++)
                {
                    tmpStr[i] = "<br />" + messageList[msgNum - tmpBig + i].MsgBody;
                }
                return tmpStr;
            }
            else
            {
                return null;
            }
        }
    }
    class MsgStructure
    {
        int msgID;
        public int MsgID
        {
            get
后面还有 33 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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