using System;
using System.Data;
using System.Configuration;
using System.Collections;
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;
using System.Data.SqlClient;

public partial class wangkems_operation : System.Web.UI.Page
{
    Cls_WangkeMS WangkeMS = new Cls_WangkeMS();

    //默认加载
    protected void Page_Load(object sender, EventArgs e)
    {
        string sUserName = Convert.ToString(Session["UserName"]);
        string sUserNickName = Convert.ToString(Session["UserNickName"]);
        string sVisitor = Convert.ToString(Session["Visitor"]);
        string sVisitorName = Convert.ToString(Session["VisitorName"]);
        switch (Request.QueryString["action"].Trim())
        {
            case "logout":
                WangkeMS.DelVisitor(sVisitor);
                break;
            case "sendmsg":
                WangkeMS.SendMsg(sUserName, sVisitor, sVisitorName, Request.QueryString["type"], HttpUtility.UrlDecode(Request.QueryString["msg"]));
                break;
            case "getmsg":
                string sMsg = null;
                WangkeMS.sMsglist.Clear();
                WangkeMS.GetMsglist(sUserName, sUserNickName, sVisitor, sVisitorName);
                for (int i = 0; i < WangkeMS.sMsglist.Count; i++)
                {
                    sMsg = WangkeMS.sMsglist[i].ToString() + sMsg;
                }
                Response.Write(sMsg);
                Response.End();
                break;
            default:
                break;
        }
    }
}