📄 msgview.aspx.cs
字号:
sDetail = sDetail.Replace(m.Groups[0].ToString(), "<img src=pic/em" + m.Groups[2].ToString() + ".gif border=0 align=middle>");
}
#endregion
#region 处[flash=x][/flash]标记
// 处[mp=x][/mp]标记
r = new Regex(@"(\[flash=)(\d*?),(\d*?)\]([ \t]*?)(\[\/flash\])", RegexOptions.IgnoreCase);
for (m = r.Match(sDetail); m.Success; m = m.NextMatch())
{
sDetail = sDetail.Replace(m.Groups[0].ToString(),
"<a href=" + m.Groups[4].ToString() + " TARGET=_blank><IMG SRC=pic/swf.gif border=0 alt=点击开新窗口欣赏该FLASH动画!> [全屏欣赏]</a><br><br><OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=" + m.Groups[2].ToString() + " height=" + m.Groups[3].ToString() + "><PARAM NAME=movie VALUE=" + m.Groups[4].ToString() + "><PARAM NAME=quality VALUE=high><param name=menu value=false><embed src=" + m.Groups[4].ToString() + " quality=high menu=false pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=" + m.Groups[2].ToString() + " height=" + m.Groups[3].ToString() + ">" + m.Groups[4].ToString() + "</embed></OBJECT>");
}
#endregion
#region 处[dir=x][/dir]标记
// 处[dir=x][/dir]标记
r = new Regex(@"(\[dir=)(\d*?),(\d*?)\]([ \t]*?)(\[\/dir\])", RegexOptions.IgnoreCase);
for (m = r.Match(sDetail); m.Success; m = m.NextMatch())
{
sDetail = sDetail.Replace(m.Groups[0].ToString(),
"<object classid=clsid:166B1BCA-3F9C-11CF-8075-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=7,0,2,0 width=" + m.Groups[2].ToString() + " height=" + m.Groups[3].ToString() + "><param name=src value=" + m.Groups[4].ToString() + "><embed src=" + m.Groups[4].ToString() + " pluginspage=http://www.macromedia.com/shockwave/download/ width=" + m.Groups[2].ToString() + " height=" + m.Groups[3].ToString() + "></embed></object>");
}
#endregion
#region 处[rm=x][/rm]标记
// 处[rm=x][/rm]标记
r = new Regex(@"(\[rm=)(\d*?),(\d*?)\]([ \t]*?)(\[\/rm\])", RegexOptions.IgnoreCase);
for (m = r.Match(sDetail); m.Success; m = m.NextMatch())
{
sDetail = sDetail.Replace(m.Groups[0].ToString(),
"<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA class=OBJECT id=RAOCX width=" + m.Groups[2].ToString() + " height=" + m.Groups[3].ToString() + "><PARAM NAME=SRC VALUE=" + m.Groups[4].ToString() + "><PARAM NAME=CONSOLE VALUE=Clip1><PARAM NAME=CONTROLS VALUE=imagewindow><PARAM NAME=AUTOSTART VALUE=true></OBJECT><br><OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA height=32 id=video2 width=" + m.Groups[2].ToString() + "><PARAM NAME=SRC VALUE=" + m.Groups[4].ToString() + "><PARAM NAME=AUTOSTART VALUE=-1><PARAM NAME=CONTROLS VALUE=controlpanel><PARAM NAME=CONSOLE VALUE=Clip1></OBJECT>");
}
#endregion
#region 处[mp=x][/mp]标记
// 处[mp=x][/mp]标记
r = new Regex(@"(\[mp=)(\d*?),(\d*?)\]([ \t]*?)(\[\/mp\])", RegexOptions.IgnoreCase);
for (m = r.Match(sDetail); m.Success; m = m.NextMatch())
{
sDetail = sDetail.Replace(m.Groups[0].ToString(),
"<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=" + m.Groups[2].ToString() + " height=" + m.Groups[3].ToString() + " ><param name=ShowStatusBar value=-1><param name=Filename value=" + m.Groups[4].ToString() + "><embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 flename=mp src=" + m.Groups[4].ToString() + " width=" + m.Groups[2].ToString() + " height=" + m.Groups[3].ToString() + "></embed></object>");
}
#endregion
#region 处[qt=x][/qt]标记
// 处[qt=x][/qt]标记
r = new Regex(@"(\[qt=)(\d*?),(\d*?)\]([ \t]*?)(\[\/qt\])", RegexOptions.IgnoreCase);
for (m = r.Match(sDetail); m.Success; m = m.NextMatch())
{
sDetail = sDetail.Replace(m.Groups[0].ToString(),
"<embed src=" + m.Groups[4].ToString() + " width=" + m.Groups[2].ToString() + " height=" + m.Groups[3].ToString() + " autoplay=true loop=false controller=true playeveryframe=false cache=false scale=TOFIT bgcolor=#000000 kioskmode=false targetcache=false pluginspage=http://www.apple.com/quicktime/>");
}
#endregion
#region 处[QUOTE][/QUOTE]标记
r = new Regex(@"(\[QUOTE\])([ \t]*?)(\[\/QUOTE\])", RegexOptions.IgnoreCase);
for (m = r.Match(sDetail); m.Success; m = m.NextMatch())
{
sDetail = sDetail.Replace(m.Groups[0].ToString(), "<table cellpadding=0 cellspacing=0 border=1 WIDTH=94% bordercolor=#000000 bgcolor=#F2F8FF align=center style=FONT-SIZE: 9pt><tr><td ><table width=100% cellpadding=5 cellspacing=1 border=0><TR><TD >" + m.Groups[2].ToString() + "</table></table><br>");
}
#endregion
#region 处[move][/move]标记
r = new Regex(@"(\[move\])([ \t]*?)(\[\/move\])", RegexOptions.IgnoreCase);
for (m = r.Match(sDetail); m.Success; m = m.NextMatch())
{
sDetail = sDetail.Replace(m.Groups[0].ToString(), "<MARQUEE scrollamount=3>" + m.Groups[2].ToString() + "</MARQUEE>");
}
#endregion
#region 处[FLY][/FLY]标记
r = new Regex(@"(\[FLY\])([ \t]*?)(\[\/FLY\])", RegexOptions.IgnoreCase);
for (m = r.Match(sDetail); m.Success; m = m.NextMatch())
{
sDetail = sDetail.Replace(m.Groups[0].ToString(), "<MARQUEE width=80% behavior=alternate scrollamount=3>" + m.Groups[2].ToString() + "</MARQUEE>");
}
#endregion
// #region 处[image][/image]标记
//// 处[image][/image]标记
// r = new Regex(@"(\[image\])([^\t]*?)(\[\/image\])", RegexOptions.IgnoreCase);
// for (m = r.Match(sDetail); m.Success; m = m.NextMatch())
// {
// sDetail = sDetail.Replace(m.Groups[0].ToString(),
// // "<img src=\"Upload/" + m.Groups[2].ToString() + "\"border=0 alt=按此在新窗口浏览图片 onload=javascript:if(screen.width-333<this.width)this.width=screen.width-333>");
// " <IMG src=\"Upload/" + m.Groups[2].ToString() +"\" border=0 alt=按此在新窗口浏览图片 onload=\"javascript:if(this.width>screen.width-333)this.width=screen.width-333\">");
// }
// #endregion
//#region 处[FLY][/FLY]标记
//r = new Regex(@"(\[FLY\])(.[^\[]*)(\[\/FLY\])", RegexOptions.IgnoreCase);
//sDetail = r.Replace(sDetail, @"<marquee onmouseover='this.stop();' onmouseout='this.start();'>$2</marquee>");
// //#endregion
//#region 处[image][/image]标记
////处[image][/image]标记
//r = new Regex(@"(\[image\])(.[^\[]*)(\[\/image\])", RegexOptions.IgnoreCase);
//sDetail = r.Replace(sDetail, @"<a href=""$2"" target=_blank><IMG SRC=""$2"" border=0 alt=按此在新窗口浏览图片 onload=""javascript:if(this.width>screen.width-333)this.width=screen.width-333""></a>");
//#endregion
#region 处[image][/image]标记
r = new Regex(@"(\[image\])([^\t]*?)(\[\/image\])", RegexOptions.IgnoreCase);
for (m = r.Match(sDetail); m.Success; m = m.NextMatch())
{
// sDetail = sDetail.Replace(m.Groups[0].ToString(),"<IMG SRC="+ m.Groups[2].ToString() + " border=0 alt=按此在新窗口浏览图片>");
// ///UpLoad/20070505074800bg1.gif
string path = "UpLoad/" + m.Groups[2].ToString();
string temp = path.Trim();
sDetail = sDetail.Replace(m.Groups[0].ToString(), "<IMG SRC=" + temp + " border=0 alt=按此在新窗口浏览图片 onload=\"javascript:if(this.width>screen.width-333)this.width=screen.width-333\"/>");
}
#endregion
#region 处[FLY][/FLY]标记
r = new Regex(@"(\[FLY\])([^\t]*?)(\[\/FLY\])", RegexOptions.IgnoreCase);
for (m = r.Match(sDetail); m.Success; m = m.NextMatch())
{
sDetail = sDetail.Replace(m.Groups[0].ToString(), "<MARQUEE width=80% behavior=alternate scrollamount=3>" + m.Groups[2].ToString() + "</MARQUEE>");
}
#endregion
//#region 处[image][/image]标记
////处[image][/image]标记
//r = new Regex(@"(\[image\])([^\t]*?)(\[\/image\])", RegexOptions.IgnoreCase);
//for (m = r.Match(sDetail); m.Success; m = m.NextMatch())
//{
// sDetail = sDetail.Replace(m.Groups[0].ToString(),
// "<img src=\"" + m.Groups[2].ToString() + "\" border=0 align=middle><br>");
//}
//#endregion
//r = new Regex(@"(\[SIZE=1\])(.[^\[]*)(\[\/SIZE\])", RegexOptions.IgnoreCase);
//sDetail = r.Replace(sDetail, @"<font size=1>$2</font>");
//r = new Regex(@"(\[SIZE=2\])(.[^\[]*)(\[\/SIZE\])", RegexOptions.IgnoreCase);
//sDetail = r.Replace(sDetail, @"<font size=2>$2</font>");
//r = new Regex(@"(\[SIZE=3\])(.[^\[]*)(\[\/SIZE\])", RegexOptions.IgnoreCase);
//sDetail = r.Replace(sDetail, @"<font size=3>$2</font>");
//r = new Regex(@"(\[SIZE=4\])(.[^\[]*)(\[\/SIZE\])", RegexOptions.IgnoreCase);
//sDetail = r.Replace(sDetail, @"<font size=4>$2</font>");
return sDetail;
}
protected void ToSendMsg_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("SendMsg.aspx");
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
//smsg
switch (e.CommandName)
{
case "smsg":
{
int index = Convert.ToInt32(e.CommandArgument) - this.GridView1.PageIndex * 10;
//获取行的位置
GridViewRow row = GridView1.Rows[index];
//获取选定行的列的位置,比如第三列,付给你自己的变量表达式,这里是全局变量varImpID
// Session["MailTo"] = row.Cells[0].Text;
Label lb = (Label)row.FindControl("UserLab");
// this.testtext.Text = row.Cells[4].Text;
String StrTemp = lb.Text;
Session["MsgTo"] = StrTemp;
Response.Redirect("SendMsg.aspx");
///////MsgBtn ImageButton2
//ImageButton ibtn = ((ImageButton)e.Row.FindControl("MsgBtn"));
//if (ibtn == null)
//{
// return;
//}
//ibtn.Enabled = true;
////switch (Convert.ToInt32((e.Row.Cells[4].Text.Trim())))
////{
//// case 1:
//ibtn.CommandArgument = e.Row.DataItemIndex.ToString();
} break;
case "DelMsg":
{
int index = Convert.ToInt32(e.CommandArgument) - this.GridView1.PageIndex * 10;
//获取行的位置
GridViewRow row = GridView1.Rows[index];
//获取选定行的列的位置,比如第三列,付给你自己的变量表达式,这里是全局变量varImpID
// Session["MailTo"] = row.Cells[0].Text;
Label lb = (Label)row.FindControl("Accept");
String StrTemp = lb.Text;
//ViewLab
Label lb2 = (Label)row.FindControl("BBsNum");
String Strcontent = lb2.Text;
delMsg(StrTemp, Strcontent);
////////////////////////////////
BindView();
} break;
default: break;
}
}
public void delMsg(string strsql,string Strcontent)
{
SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
// cmdUpdateB=new SqlCommand("update data set Datas='"+this.TextBox3.Text+"'where ID=2 ",con);
string sql;
sql = "delete from MsgInfo where AcceptMan='" + strsql + "' and BBSNum='" + Strcontent+ "'" ;
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.Connection.Open();
cmd.ExecuteNonQuery();
cmd.Connection.Close();
//// this.selspan.InnerHtml =
}
protected void GridView1_DataBound(object sender, EventArgs e)
{
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
ImageButton ibtn = ((ImageButton)e.Row.FindControl("Msgsend"));
if (ibtn == null)
{
return;
}
ibtn.Enabled = true;
//switch (Convert.ToInt32((e.Row.Cells[4].Text.Trim())))
//{
// case 1:
ibtn.CommandArgument = e.Row.DataItemIndex.ToString();
//----------------------------------------------------------------------------------------
// DelBtn
ImageButton btn = ((ImageButton)e.Row.FindControl("DelBtn"));
if ( btn == null)
{
return;
}
btn.CommandArgument = e.Row.DataItemIndex.ToString();
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
if (e.NewPageIndex == -1)
e.NewPageIndex = 0;
GridView1.PageIndex = e.NewPageIndex;
// pageindex = e.NewPageIndex;
GridView1.DataBind();
}
protected void GridView1_RowDeleted(object sender, GridViewDeletedEventArgs e)
{
}
protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e)
{
this.countlab.Text = e.AffectedRows.ToString();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -