📄 info.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
namespace xajh.chat
{
/// <summary>
/// info 的摘要说明。
/// </summary>
public class info
{
private System.Web.HttpContext xajh = System.Web.HttpContext.Current;
public void Start(string myname, string isinchat, DateTime oldtime)
{
if (this.xajh.Request.Cookies["byts"] == null || myname != this.xajh.Request.Cookies["byts"]["chat"])
{
this.xajh.Session.Abandon();
this.xajh.Response.Write ("<script language=javascript type=text/javascript>top.location.href='../error.aspx?v=%c7%eb%b2%bb%d2%aa%cd%ac%ca%b1%ca%b9%d3%c3%c1%bd%b8%f6%c3%fb%d7%d6%b5%c7%c2%bd%bb%f2%d6%d0%cd%be%c9%be%b3%fdcookie!'</script>");
this.xajh.Response.End();
}
if (isinchat == "false")
{
this.xajh.Response.Write ("<script language=javascript type=text/javascript>top.location.href='../error.aspx?v=outchat'</script>");
this.xajh.Response.End();
}
if (oldtime.AddSeconds(3) > DateTime.Now)
{
this.xajh.Response.Write ("<script language=javascript type=text/javascript>alert('慢慢来,别噎着哦!')</script>");
this.xajh.Response.End();
}
}
public x.UserInfo Update(string showword, string showhead, x.UserInfo info)
{
string myonline = info.UserName + "|" + info.DataID + "|" + info.Sex + "|" + info.Ico + "|" + info.Grade + "|" + info.FGrade + "|" + info.Gold + "|" + info.CloseDoor + "|" + info.MyClass + "|" + info.MyHead + "|" + info.MyJob;
string[] aword = new string[9];
aword[0] = "update";
aword[1] = info.UserName;
aword[2] = info.UserName;
aword[3] = myonline;
aword[4] = "";
aword[5] = "";
aword[6] = showword;
aword[7] = showhead;
aword[8] = DateTime.Now.ToLongTimeString();
this.xajh.Application.Lock();
var.public_onlineinfo[info.UserName] = myonline;
ArrayList words = (ArrayList) this.xajh.Application["byts_xajh_chat_words_" + info.RoomID];
words.Add(aword);
words.RemoveAt(0);
this.xajh.Application["byts_xajh_chat_line_" + info.RoomID] = (int) this.xajh.Application["byts_xajh_chat_line_" + info.RoomID] + 1;
int all_line = (int) this.xajh.Application["byts_xajh_chat_line_" + info.RoomID];
this.xajh.Application.UnLock();
int check_line = 30 - (all_line - info.MsgLine);
if (check_line < 0)
{
check_line = 0;
}
string[] mywords;
this.xajh.Response.Write ("<script language=javascript type=text/javascript>\r");
for (int myline = check_line; myline < 30; myline ++)
{
mywords = (string[]) words[myline];
if (!(mywords[0] == "only" && mywords[1] != info.UserName && mywords[2] != info.UserName))
{
this.xajh.Response.Write ("parent.h0.byts_getmsg(\"" + mywords[0] + "\",\"" + mywords[1] + "\",\"" + mywords[2] + "\",\"" + mywords[3] + "\",\"" + mywords[4] + "\",\"" + mywords[5] + "\",\"" + mywords[6] + "\",\"" + mywords[7] + "\",\"" + mywords[8] + "\");\r");
}
}
this.xajh.Response.Write ("</script>");
info.MsgLine = all_line;
info.LastSaid = DateTime.Now;
return info;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -