Пример #1
0
        private void cmdOK_ServerClick(object sender, System.EventArgs e)
        {
            BBSClass bbs = new BBSClass();
            BBSForumItem item = new BBSForumItem();
            string itemcontent = ViewState["Content"] + Content.Value;
            item.BoardID = Int32.Parse(boardid);
            item.Title   = MyTitle.Value.Replace("<","&lt");
            item.Title   = item.Title.Replace(">","&gt");
            if(item.Title.Trim()=="") item.Title = "�ޱ���";
            item.Content = itemcontent.Replace("<","&lt");
            item.Content = item.Content.Replace(">","&gt");
            item.Sender  = username;
            item.IP      = Request.ServerVariables["remote_addr"].ToString();
            item.Bulletin = (cbx_bulletin==null)?false:cbx_bulletin.Checked;
            item.SysBulletin = (cbx_bulletin==null)?false:cbx_sysbulletin.Checked;
            item.DeskTop = (cbx_DeskTop==null)?false:cbx_DeskTop.Checked;

            item.ItemID = bbs.SendItem(item);
            if(ViewState["filename"]!=null && ViewState["filename"].ToString().Trim()!="")
                item.Attach(ViewState["filename"].ToString());
            try
            {
                Response.Write("<script>if(opener!=null) {opener.location.reload();opener.parent.parent.header.location.reload();location.href='Display.aspx?ItemID="+item.ItemID.ToString()+"&BoardID="+item.BoardID.ToString()+"'}</script>");
            }
            catch(Exception ex)
            {
                UDS.Components.Error.Log(ex.Message);
                Server.Transfer("../../Error.aspx");
            }
        }