SWFUpload是一个flash和js相结合而成的文件上传插件,其功能非常强大。以前在项目中用过几次,但它的配置参数太多了,用过后就忘记怎么用了,到以后要用时又得到官网上看它的文档,真是太烦了。所以
http://www.runoob.com/w3cnote/swfupload-guide.html
- 1、引入相应的js文件
- 2、实例化SWFUpload对象,传入一个配置参数对象进行各方面的配置。
- 3、点击SWFUpload提供的Flash按钮,弹出文件选取窗口选择要上传的文件;
- 4、文件选取完成后符合规定的文件会被添加到上传的队列里;
- 5、调用startUpload方法让队列里文件开始上传;
- 6、文件上传过程中会触发相应的事件,开发者利用这些事件来更新ui、处理错误、发出提示等等;
- 使用
1 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SWFUpload_Demo.aspx.cs" Inherits="BookShop.Web.Test.SWFUpload_Demo" %> 2 3 <!DOCTYPE html> 4 5 <html xmlns="http://www.w3.org/1999/xhtml"> 6 <head runat="server"> 7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 8 <title></title> 9 <script src="../js/jquery-1.7.1.js"></script> 10 <script src="../SWFUpload/swfupload.js"></script> 11 <script src="../SWFUpload/handlers.js"></script> 12 <script type="text/javascript"> 13 var swfu; 14 window.onload = function () { 15 swfu = new SWFUpload({ 16 // Backend Settings 17 upload_url: "/ashx/upload.ashx", 18 post_params: { 19 "ASPSESSID": "<%=Session.SessionID %>" 20 }, 21 22 // File Upload Settings 23 file_size_limit: "2 MB", 24 file_types: "*.jpg;*.gif", 25 file_types_description: "JPG Images", 26 file_upload_limit: 0, // Zero means unlimited 27 28 // Event Handler Settings - these functions as defined in Handlers.js 29 // The handlers are not part of SWFUpload but are part of my website and control how 30 // my website reacts to the SWFUpload events. 31 swfupload_preload_handler: preLoad, 32 swfupload_load_failed_handler: loadFailed, 33 file_queue_error_handler: fileQueueError, 34 file_dialog_complete_handler: fileDialogComplete, 35 upload_progress_handler: uploadProgress, 36 upload_error_handler: uploadError, 37 upload_success_handler: showImage, 38 upload_complete_handler: uploadComplete, 39 40 // Button settings 41 button_image_url: "/SWFUpload/images/XPButtonNoText_160x22.png", 42 button_placeholder_id: "spanButtonPlaceholder", 43 button_ 160, 44 button_height: 22, 45 button_text: '<span class="button">请选择上传图片<span class="buttonSmall">(2 MB Max)</span></span>', 46 button_text_style: '.button { font-family: Helvetica, Arial, sans-serif; font-size: 14pt; } .buttonSmall { font-size: 10pt; }', 47 button_text_top_padding: 1, 48 button_text_left_padding: 5, 49 50 // Flash Settings 51 flash_url: "/SWFUpload/swfupload.swf", // Relative to this file 52 flash9_url: "/SWFUpload/swfupload_FP9.swf", // Relative to this file 53 54 custom_settings: { 55 upload_target: "divFileProgressContainer" 56 }, 57 58 // Debug Settings 59 debug: false 60 }); 61 } 62 //上传成功以后调用该方法 63 function showImage(file, serverData) { 64 $("#showPhoto").attr("src", serverData); 65 } 66 67 </script> 68 </head> 69 <body> 70 <form id="form1" runat="server"> 71 72 <div id="content"> 73 <div id="swfu_container" style="margin: 0px 10px;"> 74 <div> 75 aaaaaaa 76 <span id="spanButtonPlaceholder"></span> 77 aaaaaa 78 </div> 79 ssssssssssssss 80 <div id="divFileProgressContainer" style="height: 75px;"></div> 81 sssssssssss 82 <div id="thumbnails"></div> 83 <img id="showPhoto"></img> 84 </div> 85 </div> 86 </form> 87 </body> 88 </html>
imgAreaSelect
ImgAreaSelect是一jQuery插件,它支持用户通过鼠标拖曳选择图片的一部分,非常的fashion。另外,可以在这个选择图像区域的基础上应用网站的其他一些技术,比如图片拖曳、图片编辑等。
1 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CutPhoto.aspx.cs" Inherits="BookShop.Web.Member.CutPhoto" %> 2 3 <!DOCTYPE html> 4 5 <html xmlns="http://www.w3.org/1999/xhtml"> 6 <head runat="server"> 7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 8 <title></title> 9 <link href="../Css/themes/ui-lightness/jquery-ui-1.8.2.custom.css" rel="stylesheet" /> 10 <script src="../js/jquery-1.7.1.js"></script> 11 <script src="../js/jquery-ui-1.8.2.custom.min.js"></script> 12 <script src="../SWFUpload/swfupload.js"></script> 13 <script src="../SWFUpload/handlers.js"></script> 14 <script type="text/javascript"> 15 var swfu; 16 window.onload = function () { 17 swfu = new SWFUpload({ 18 // Backend Settings 19 upload_url: "/ashx/upload.ashx?action=upload", 20 post_params: { 21 "ASPSESSID": "<%=Session.SessionID %>" 22 }, 23 24 // File Upload Settings 25 file_size_limit: "2 MB", 26 file_types: "*.jpg;*.gif", 27 file_types_description: "JPG Images", 28 file_upload_limit: 0, // Zero means unlimited 29 30 // Event Handler Settings - these functions as defined in Handlers.js 31 // The handlers are not part of SWFUpload but are part of my website and control how 32 // my website reacts to the SWFUpload events. 33 swfupload_preload_handler: preLoad, 34 swfupload_load_failed_handler: loadFailed, 35 file_queue_error_handler: fileQueueError, 36 file_dialog_complete_handler: fileDialogComplete, 37 upload_progress_handler: uploadProgress, 38 upload_error_handler: uploadError, 39 upload_success_handler: showImage, 40 upload_complete_handler: uploadComplete, 41 42 // Button settings 43 button_image_url: "/SWFUpload/images/XPButtonNoText_160x22.png", 44 button_placeholder_id: "spanButtonPlaceholder", 45 button_ 160, 46 button_height: 22, 47 button_text: '<span class="button">请选择上传图片<span class="buttonSmall">(2 MB Max)</span></span>', 48 button_text_style: '.button { font-family: Helvetica, Arial, sans-serif; font-size: 14pt; } .buttonSmall { font-size: 10pt; }', 49 button_text_top_padding: 1, 50 button_text_left_padding: 5, 51 52 // Flash Settings 53 flash_url: "/SWFUpload/swfupload.swf", // Relative to this file 54 flash9_url: "/SWFUpload/swfupload_FP9.swf", // Relative to this file 55 56 custom_settings: { 57 upload_target: "divFileProgressContainer" 58 }, 59 60 // Debug Settings 61 debug: false 62 }); 63 } 64 //上传成功以后调用该方法 65 function showImage(file, serverData) { 66 // $("#showPhoto").attr("src", serverData); 67 var data = serverData.split(':'); 68 //将上传成功的图片作为DIV的背景 69 $("#hiddenImageUrl").val(data[0]);//将上传成功的图片路径存储到隐藏域中。 70 $("#divContent").css("backgroundImage", "url('" + data[0] + "')").css("width",data[1]+"px").css("height",data[2]+"px"); 71 } 72 73 $(function () { 74 //让DIV可以移动与拖动大小 75 $("#divCut").draggable({ containment: "#divContent", scroll: false }).resizable({ 76 containment: "#divContent" 77 }); 78 $("#btnCut").click(function () { 79 cutPhoto(); 80 }); 81 }) 82 //截取头像 83 function cutPhoto() { 84 //计算要截取的头像的范围。 85 var y = $("#divCut").offset().top - $("#divContent").offset().top;//纵坐标 86 var x = $("#divCut").offset().left - $("#divContent").offset().left; 87 var width = $("#divCut").width(); 88 var heigth = $("#divCut").height(); 89 var pars = { 90 "x": x, 91 "y": y, 92 "width": width, 93 "height": heigth, 94 "action": "cut", 95 "imgSrc": $("#hiddenImageUrl").val() 96 97 }; 98 $.post("/ashx/upload.ashx", pars, function (data) { 99 $("#showPhoto").attr("src",data); 100 }); 101 102 } 103 104 </script> 105 </head> 106 <body> 107 <form id="form1" runat="server"> 108 <div id="content"> 109 <div id="swfu_container" style="margin: 0px 10px;"> 110 <div> 111 <span id="spanButtonPlaceholder"></span> 112 </div> 113 <div id="divFileProgressContainer" style="height: 75px;"></div> 114 <div id="thumbnails"></div> 115 <div id="divContent" style="300px; height:300px;"> 116 <div id="divCut" style="100px;height:100px; border:solid red 1px"> 117 </div> 118 119 </div> 120 <input type="button" value="截取图片" id="btnCut" /> 121 <input type="hidden" id="hiddenImageUrl" /> 122 <img id="showPhoto"></img> 123 </div> 124 </div> 125 </form> 126 </body> 127 </html>
.CKEditor使用
CKEditor 简介
CKEditor 是一款功能强大的开源在线文本编辑器。它所见即所得的特点,使你在编辑时所看到的内容和格式,能够与发布后看到的效果完全一致。CKEditor 完全是基于 JavaScript 开发的,因此不必在客户端进行任何安装,并且兼容各大主流浏览器。CKEditor 的前身是 FCKEditor,目前,有很多公司都在使用 CKEditor 作为 Web 编辑的解决方案。
http://blog.csdn.net/ljhabc1982/article/details/6546425
UBB编辑器的使用
1 /// <summary> 2 /// UBB代码处理函数 3 /// </summary> 4 /// <param name="sDetail">输入字符串</param> 5 /// <returns>输出字符串</returns> 6 public static string UBBToHTML(string sDetail) 7 { 8 Regex r; 9 Match m; 10 #region 处理空格 11 sDetail = sDetail.Replace(" ", " "); 12 #endregion 13 #region 处理单引号 14 sDetail = sDetail.Replace("'", "’"); 15 #endregion 16 #region 处理双引号 17 sDetail = sDetail.Replace(""", """); 18 #endregion 19 #region html标记符 20 sDetail = sDetail.Replace("<", "<"); 21 sDetail = sDetail.Replace(">", ">"); 22 23 #endregion 24 #region 处理换行 25 //处理换行,在每个新行的前面添加两个全角空格 26 r = new Regex(@"( (( )| )+)(?<正文>S+)", RegexOptions.IgnoreCase); 27 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 28 { 29 sDetail = sDetail.Replace(m.Groups[0].ToString(), "<BR> " + m.Groups["正文"].ToString()); 30 } 31 //处理换行,在每个新行的前面添加两个全角空格 32 sDetail = sDetail.Replace(" ", "<BR>"); 33 #endregion 34 #region 处[b][/b]标记 35 r = new Regex(@"([b])([ S ]*?)([/b])", RegexOptions.IgnoreCase); 36 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 37 { 38 sDetail = sDetail.Replace(m.Groups[0].ToString(), "<B>" + m.Groups[2].ToString() + "</B>"); 39 } 40 #endregion 41 #region 处[i][/i]标记 42 r = new Regex(@"([i])([ S ]*?)([/i])", RegexOptions.IgnoreCase); 43 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 44 { 45 sDetail = sDetail.Replace(m.Groups[0].ToString(), "<I>" + m.Groups[2].ToString() + "</I>"); 46 } 47 #endregion 48 #region 处[u][/u]标记 49 r = new Regex(@"([U])([ S ]*?)([/U])", RegexOptions.IgnoreCase); 50 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 51 { 52 sDetail = sDetail.Replace(m.Groups[0].ToString(), "<U>" + m.Groups[2].ToString() + "</U>"); 53 } 54 #endregion 55 #region 处[p][/p]标记 56 //处[p][/p]标记 57 r = new Regex(@"(( )*[p])(.*?)(( )*[/p])", RegexOptions.IgnoreCase | RegexOptions.Singleline); 58 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 59 { 60 sDetail = sDetail.Replace(m.Groups[0].ToString(), "<P class="pstyle">" + m.Groups[3].ToString() + "</P>"); 61 } 62 #endregion 63 #region 处[sup][/sup]标记 64 //处[sup][/sup]标记 65 r = new Regex(@"([sup])([ S ]*?)([/sup])", RegexOptions.IgnoreCase); 66 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 67 { 68 sDetail = sDetail.Replace(m.Groups[0].ToString(), "<SUP>" + m.Groups[2].ToString() + "</SUP>"); 69 } 70 #endregion 71 #region 处[sub][/sub]标记 72 //处[sub][/sub]标记 73 r = new Regex(@"([sub])([ S ]*?)([/sub])", RegexOptions.IgnoreCase); 74 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 75 { 76 sDetail = sDetail.Replace(m.Groups[0].ToString(), "<SUB>" + m.Groups[2].ToString() + "</SUB>"); 77 } 78 #endregion 79 #region 处标记 80 //处标记 81 r = new Regex(@"([url])([ S ]*?)([/url])", RegexOptions.IgnoreCase); 82 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 83 { 84 sDetail = sDetail.Replace(m.Groups[0].ToString(), 85 "<A href="" + m.Groups[2].ToString() + "" target="_blank">" + m.Groups[2].ToString() + "</A>"); 86 } 87 #endregion 88 #region 处[url=xxx][/url]标记 89 //处[url=xxx][/url]标记 90 r = new Regex(@"([url=([ S ]+)])([ S ]*?)([/url])", RegexOptions.IgnoreCase); 91 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 92 { 93 sDetail = sDetail.Replace(m.Groups[0].ToString(), 94 "<A href="" + m.Groups[2].ToString() + "" target="_blank">" 95 + m.Groups[3].ToString() + "</A>"); 96 } 97 #endregion 98 #region 处[email][/email]标记 99 //处[email][/email]标记 100 r = new Regex(@"([email])([ S ]*?)([/email])", RegexOptions.IgnoreCase); 101 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 102 { 103 sDetail = sDetail.Replace(m.Groups[0].ToString(), 104 "<A href="mailto:" + m.Groups[2].ToString() + "" target="_blank">" + 105 m.Groups[2].ToString() + "</A>"); 106 } 107 #endregion 108 #region 处[email=xxx][/email]标记 109 //处[email=xxx][/email]标记 110 r = new Regex(@"([email=([ S ]+)])([ S ]*?)([/email])", RegexOptions.IgnoreCase); 111 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 112 { 113 sDetail = sDetail.Replace(m.Groups[0].ToString(), 114 "<A href="mailto:" + m.Groups[2].ToString() + "" target="_blank">" + 115 m.Groups[3].ToString() + "</A>"); 116 } 117 #endregion 118 #region 处[size=x][/size]标记 119 //处[size=x][/size]标记 120 r = new Regex(@"([size=([1-7])])([ S ]*?)([/size])", RegexOptions.IgnoreCase); 121 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 122 { 123 sDetail = sDetail.Replace(m.Groups[0].ToString(), 124 "<FONT SIZE=" + m.Groups[2].ToString() + ">" + 125 m.Groups[3].ToString() + "</FONT>"); 126 } 127 #endregion 128 #region 处[color=x][/color]标记 129 //处[color=x][/color]标记 130 r = new Regex(@"([color=([S]+)])([ S ]*?)([/color])", RegexOptions.IgnoreCase); 131 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 132 { 133 sDetail = sDetail.Replace(m.Groups[0].ToString(), 134 "<FONT COLOR=" + m.Groups[2].ToString() + ">" + 135 m.Groups[3].ToString() + "</FONT>"); 136 } 137 #endregion 138 #region 处[font=x][/font]标记 139 //处[font=x][/font]标记 140 r = new Regex(@"([font=([S]+)])([ S ]*?)([/font])", RegexOptions.IgnoreCase); 141 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 142 { 143 sDetail = sDetail.Replace(m.Groups[0].ToString(), 144 "<FONT FACE=" + m.Groups[2].ToString() + ">" + 145 m.Groups[3].ToString() + "</FONT>"); 146 } 147 #endregion 148 #region 处理图片链接 149 //处理图片链接 150 r = new Regex("\[picture\](\d+?)\[\/picture\]", RegexOptions.IgnoreCase); 151 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 152 { 153 sDetail = sDetail.Replace(m.Groups[0].ToString(), 154 "<A href="ShowImage.aspx?Type=ALL&Action=forumImage&ImageID=" + m.Groups[1].ToString() + "" target="_blank"><IMG border=0 Title="点击打开新窗口查看" src="ShowImage.aspx?Action=forumImage&ImageID=" + m.Groups[1].ToString() + ""></A>"); 155 } 156 #endregion 157 #region 处理[align=x][/align] 158 //处理[align=x][/align] 159 r = new Regex(@"([align=([S]+)])([ S ]*?)([/align])", RegexOptions.IgnoreCase); 160 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 161 { 162 sDetail = sDetail.Replace(m.Groups[0].ToString(), 163 "<P align=" + m.Groups[2].ToString() + ">" + 164 m.Groups[3].ToString() + "</P>"); 165 } 166 #endregion 167 #region 处[H=x][/H]标记 168 //处[H=x][/H]标记 169 r = new Regex(@"([H=([1-6])])([ S ]*?)([/H])", RegexOptions.IgnoreCase); 170 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 171 { 172 sDetail = sDetail.Replace(m.Groups[0].ToString(), 173 "<H" + m.Groups[2].ToString() + ">" + 174 m.Groups[3].ToString() + "</H" + m.Groups[2].ToString() + ">"); 175 } 176 #endregion 177 #region 处理[list=x][*][/list] 178 //处理[list=x][*][/list] 179 r = new Regex(@"([list(=(A|a|I|i| ))?]([ S ]*) )(([*]([ S ]* ))*?)([/list])", RegexOptions.IgnoreCase); 180 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 181 { 182 string strLI = m.Groups[5].ToString(); 183 Regex rLI = new Regex(@"[*]([ S ]* ?)", RegexOptions.IgnoreCase); 184 Match mLI; 185 for (mLI = rLI.Match(strLI); mLI.Success; mLI = mLI.NextMatch()) 186 { 187 strLI = strLI.Replace(mLI.Groups[0].ToString(), "<LI>" + mLI.Groups[1]); 188 } 189 sDetail = sDetail.Replace(m.Groups[0].ToString(), 190 "<UL TYPE="" + m.Groups[3].ToString() + ""><B>" + m.Groups[4].ToString() + "</B>" + 191 strLI + "</UL>"); 192 } 193 194 #endregion 195 #region 处[SHADOW=x][/SHADOW]标记 196 //处[SHADOW=x][/SHADOW]标记 197 r = new Regex(@"([SHADOW=)(d*?),(#*w*?),(d*?)]([S ]*?)([/SHADOW])", RegexOptions.IgnoreCase); 198 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 199 { 200 sDetail = sDetail.Replace(m.Groups[0].ToString(), 201 "<TABLE WIDTH=" + m.Groups[2].ToString() + "STYLE=FILTER:SHADOW(COLOR=" + m.Groups[3].ToString() + ",STRENGTH=" + m.Groups[4].ToString() + ")>" + m.Groups[5].ToString() + "</TABLE>"); 202 } 203 #endregion 204 #region 处[glow=x][/glow]标记 205 //处[glow=x][/glow]标记 206 r = new Regex(@"([glow=)(d*?),(#*w*?),(d*?)]([S ]*?)([/glow])", RegexOptions.IgnoreCase); 207 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 208 { 209 sDetail = sDetail.Replace(m.Groups[0].ToString(), 210 "<TABLE WIDTH=" + m.Groups[2].ToString() + " STYLE=FILTER:GLOW(COLOR=" + m.Groups[3].ToString() + ", STRENGTH=" + m.Groups[4].ToString() + ")>" + 211 m.Groups[5].ToString() + "</TABLE>"); 212 } 213 #endregion 214 #region 处[center][/center]标记 215 r = new Regex(@"([center])([ S ]*?)([/center])", RegexOptions.IgnoreCase); 216 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 217 { 218 sDetail = sDetail.Replace(m.Groups[0].ToString(), "<CENTER>" + m.Groups[2].ToString() + "</CENTER>"); 219 } 220 #endregion 221 #region 处[ IMG][ /IMG]标记 222 r = new Regex(@"([IMG])(http|https|ftp)://([ S ]*?)([/IMG])", RegexOptions.IgnoreCase); 223 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 224 { 225 sDetail = sDetail.Replace(m.Groups[0].ToString(), "<br><a onfocus=this.blur() href=" + m.Groups[2].ToString() + "://" + m.Groups[3].ToString() + " target=_blank><IMG SRC=" + m.Groups[2].ToString() + "://" + m.Groups[3].ToString() + " border=0 alt=按此在新窗口浏览图片 onload=javascript:if(screen.width-333<this.width)this.width=screen.width-333></a>"); 226 } 227 #endregion 228 #region 处[em]标记 229 r = new Regex(@"([em([S ]*?)])", RegexOptions.IgnoreCase); 230 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 231 { 232 sDetail = sDetail.Replace(m.Groups[0].ToString(), "<img src=pic/em" + m.Groups[2].ToString() + ".gif border=0 align=middle>"); 233 } 234 #endregion 235 #region 处[flash=x][/flash]标记 236 //处[mp=x][/mp]标记 237 r = new Regex(@"([flash=)(d*?),(d*?)]([S ]*?)([/flash])", RegexOptions.IgnoreCase); 238 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 239 { 240 sDetail = sDetail.Replace(m.Groups[0].ToString(), 241 "<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>"); 242 } 243 #endregion 244 #region 处[dir=x][/dir]标记 245 //处[dir=x][/dir]标记 246 r = new Regex(@"([dir=)(d*?),(d*?)]([S ]*?)([/dir])", RegexOptions.IgnoreCase); 247 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 248 { 249 sDetail = sDetail.Replace(m.Groups[0].ToString(), 250 "<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>"); 251 } 252 #endregion 253 #region 处[rm=x][/rm]标记 254 //处[rm=x][/rm]标记 255 r = new Regex(@"([rm=)(d*?),(d*?)]([S ]*?)([/rm])", RegexOptions.IgnoreCase); 256 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 257 { 258 sDetail = sDetail.Replace(m.Groups[0].ToString(), 259 "<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>"); 260 } 261 #endregion 262 #region 处[mp=x][/mp]标记 263 //处[mp=x][/mp]标记 264 r = new Regex(@"([mp=)(d*?),(d*?)]([S ]*?)([/mp])", RegexOptions.IgnoreCase); 265 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 266 { 267 sDetail = sDetail.Replace(m.Groups[0].ToString(), 268 "<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>"); 269 } 270 #endregion 271 #region 处[qt=x][/qt]标记 272 //处[qt=x][/qt]标记 273 r = new Regex(@"([qt=)(d*?),(d*?)]([S ]*?)([/qt])", RegexOptions.IgnoreCase); 274 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 275 { 276 sDetail = sDetail.Replace(m.Groups[0].ToString(), 277 "<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/>"); 278 } 279 #endregion 280 #region 处[QUOTE][/QUOTE]标记 281 r = new Regex(@"([QUOTE])([ S ]*?)([/QUOTE])", RegexOptions.IgnoreCase); 282 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 283 { 284 sDetail = sDetail.Replace(m.Groups[0].ToString(), "<div style='border:#CCCCCC 1px dashed; 94%; color:#999999; padding:3px; background:#F8F8F8'>" + m.Groups[2].ToString() + "</div><br /> "); 285 } 286 #endregion 287 #region 处[move][/move]标记 288 r = new Regex(@"([move])([ S ]*?)([/move])", RegexOptions.IgnoreCase); 289 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 290 { 291 sDetail = sDetail.Replace(m.Groups[0].ToString(), "<MARQUEE scrollamount=3>" + m.Groups[2].ToString() + "</MARQUEE>"); 292 } 293 #endregion 294 #region 处[FLY][/FLY]标记 295 r = new Regex(@"([FLY])([ S ]*?)([/FLY])", RegexOptions.IgnoreCase); 296 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 297 { 298 sDetail = sDetail.Replace(m.Groups[0].ToString(), "<MARQUEE width=80% behavior=alternate scrollamount=3>" + m.Groups[2].ToString() + "</MARQUEE>"); 299 } 300 #endregion 301 #region 处[image][/image]标记 302 //处[image][/image]标记 303 r = new Regex(@"([image])([ S ]*?)([/image])", RegexOptions.IgnoreCase); 304 for (m = r.Match(sDetail); m.Success; m = m.NextMatch()) 305 { 306 sDetail = sDetail.Replace(m.Groups[0].ToString(), 307 "<img src="" + m.Groups[2].ToString() + "" border=0 align=middle><br>"); 308 } 309 #endregion 310 311 return sDetail; 312 }
bootstrap-3.3.0-dist的使用