UBB的C#完整版[转]

None.gif using  system; 
None.gif
using  system.text; 
None.gif
using  system.text.regularexpressions; 
None.gif
None.gif
namespace  myluntan 
ExpandedBlockStart.gifContractedBlock.gif
dot.gif
InBlock.gif    
// <summary> 
InBlock.gif    
// ubb 的摘要说明。 
InBlock.gif    
// </summary> 
InBlock.gif
    public class ubb 
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif
InBlock.gif        
public ubb() 
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif
InBlock.gif
ExpandedSubBlockEnd.gif        }
 
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif        
公共静态方法#region 公共静态方法 
InBlock.gif        
// <summary> 
InBlock.gif        
// ubb代码处理函数 
InBlock.gif        
// </summary> 
InBlock.gif        
// <param name="sdetail">输入字符串</param> 
InBlock.gif        
// <returns>输出字符串</returns> 
InBlock.gif
        public string ubbtohtml(string sdetail) 
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif
InBlock.gif            regex r; 
InBlock.gif            match m; 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处理空格#region 处理空格 
InBlock.gif            sdetail 
= sdetail.replace(" ""!amp;nbsp;"); 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处理单引号#region 处理单引号 
InBlock.gif            sdetail 
= sdetail.replace("'""!rsquo;"); 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处理双引号#region 处理双引号 
InBlock.gif            sdetail 
= sdetail.replace("\"""!amp;quot;"); 
ExpandedSubBlockEnd.gif
            #endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
html标记符#region html标记符 
InBlock.gif            sdetail 
= sdetail.replace("<""!amp;lt;"); 
InBlock.gif            sdetail 
= sdetail.replace(">""!amp;gt;"); 
InBlock.gif
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处理换行#region 处理换行 
InBlock.gif            
//处理换行,在每个新行的前面添加两个全角空格 
InBlock.gif
            r = new regex(@"(\r\n((!amp;nbsp;)| )+)(@<正文>\s+)", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), "<br>  " + m.groups["正文"].tostring()); 
ExpandedSubBlockEnd.gif            }
 
InBlock.gif            
//处理换行,在每个新行的前面添加两个全角空格 
InBlock.gif
            sdetail = sdetail.replace("\r\n""<br>"); 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处标记#region 处标记 
InBlock.gif            r 
= new regex(@"(\[b\])([ \s\t]*@)(\[\/b\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), "<b>" + m.groups[2].tostring() + "</b>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处标记#region 处标记 
InBlock.gif            r 
= new regex(@"(\[i\])([ \s\t]*@)(\[\/i\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), "<i>" + m.groups[2].tostring() + "</i>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处标记#region 处标记 
InBlock.gif            r 
= new regex(@"(\[u\])([ \s\t]*@)(\[\/u\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), "<u>" + m.groups[2].tostring() + "</u>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[p][/p]标记#region 处[p][/p]标记 
InBlock.gif            
//处[p][/p]标记 
InBlock.gif
            r = new regex(@"((\r\n)*\[p\])(.*@)((\r\n)*\[\/p\])", regexoptions.ignorecase | regexoptions.singleline); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), "<p class=\"pstyle\">" + m.groups[3].tostring() + "</p>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处标记#region 处标记 
InBlock.gif            
//处标记 
InBlock.gif
            r = new regex(@"(\[sup\])([ \s\t]*@)(\[\/sup\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), "<sup>" + m.groups[2].tostring() + "</sup>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处标记#region 处标记 
InBlock.gif            
//处标记 
InBlock.gif
            r = new regex(@"(\[sub\])([ \s\t]*@)(\[\/sub\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), "<sub>" + m.groups[2].tostring() + "</sub>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[url][/url]标记#region 处[url][/url]标记 
InBlock.gif            
//处[url][/url]标记 
InBlock.gif
            r = new regex(@"(\[url\])([ \s\t]*@)(\[\/url\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<a href=/ddvipcom/\"" + m.groups[2].tostring() + "\" target=\"_blank\">" + 
InBlock.gif                m.groups[
2].tostring() + "</a>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[url=xxx][/url]标记#region 处[url=xxx][/url]标记 
InBlock.gif            
//处[url=xxx][/url]标记 
InBlock.gif
            r = new regex(@"(\[url=([ \s\t]+)\])([ \s\t]*@)(\[\/url\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<a href=/ddvipcom/\"" + m.groups[2].tostring() + "\" target=\"_blank\">" + 
InBlock.gif                m.groups[
3].tostring() + "</a>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处 [/email]标记#region 处 [/email]标记 
InBlock.gif            
//处 [/email]标记 
InBlock.gif
            r = new regex(@"(\[email\])([ \s\t]*@)(\[\/email\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<a href=/ddvipcom/\"mailto:" + m.groups[2].tostring() + "\" target=\"_blank\">" + 
InBlock.gif                m.groups[
2].tostring() + "</a>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[email=xxx][/email]标记#region 处[email=xxx][/email]标记 
InBlock.gif            
//处[email=xxx][/email]标记 
InBlock.gif
            r = new regex(@"(\[email=([ \s\t]+)\])([ \s\t]*@)(\[\/email\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<a href=/ddvipcom/\"mailto:" + m.groups[2].tostring() + "\" target=\"_blank\">" + 
InBlock.gif                m.groups[
3].tostring() + "</a>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[size=x][/size]标记#region 处[size=x][/size]标记 
InBlock.gif            
//处[size=x][/size]标记 
InBlock.gif
            r = new regex(@"(\[size=([1-7])\])([ \s\t]*@)(\[\/size\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<font size=" + m.groups[2].tostring() + ">" + 
InBlock.gif                m.groups[
3].tostring() + "</font>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[color=x][/color]标记#region 处[color=x][/color]标记 
InBlock.gif            
//处[color=x][/color]标记 
InBlock.gif
            r = new regex(@"(\[color=([\s]+)\])([ \s\t]*@)(\[\/color\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<font color=" + m.groups[2].tostring() + ">" + 
InBlock.gif                m.groups[
3].tostring() + "</font>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处标记#region 处标记 
InBlock.gif            
//处标记 
InBlock.gif
            r = new regex(@"(\[font=([\s]+)\])([ \s\t]*@)(\[\/font\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<font face=" + m.groups[2].tostring() + ">" + 
InBlock.gif                m.groups[
3].tostring() + "</font>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处理图片链接#region 处理图片链接 
InBlock.gif            
//处理图片链接 
InBlock.gif
            r = new regex("\\[picture\\](\\d+@)\\[\\/picture\\]", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<a href=/ddvipcom/\"showimage.aspx@type=all!amp;action=forumimage!amp;imageid=" + m.groups[1].tostring() + 
InBlock.gif
                "\" target=\"_blank\"><img border=0 title=\"点击打开新窗口查看\" src=http://www.ddvip.com/\"showimage.aspx@action=forumimage!amp;imageid=" + m.groups[1].tostring() + 
InBlock.gif
                "\"></a>"); 
ExpandedSubBlockEnd.gif
            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处理[align=x][/align]#region 处理[align=x][/align] 
InBlock.gif            
//处理[align=x][/align] 
InBlock.gif
            r = new regex(@"(\[align=([\s]+)\])([ \s\t]*@)(\[\/align\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<p align=" + m.groups[2].tostring() + ">" + 
InBlock.gif                m.groups[
3].tostring() + "</p>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[h=x][/h]标记#region 处[h=x][/h]标记 
InBlock.gif            
//处[h=x][/h]标记 
InBlock.gif
            r = new regex(@"(\[h=([1-6])\])([ \s\t]*@)(\[\/h\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<h" + m.groups[2].tostring() + ">" + 
InBlock.gif                m.groups[
3].tostring() + "</h" + m.groups[2].tostring() + ">"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处理#region 处理 
InBlock.gif
InBlock.gif
InBlock.gif            
//处理 
InBlock.gif

InBlock.gif
InBlock.gif            r 
= new regex(@"(\[list(=(a|a|i|i| ))@\]([ \s\t]*)\r\n)((\[\*\]([ \s\t]*\r\n))*@)(\[\/list\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                
string strli = m.groups[5].tostring(); 
InBlock.gif                regex rli 
= new regex(@"\[\*\]([ \s\t]*\r\n@)", regexoptions.ignorecase); 
InBlock.gif                match mli; 
InBlock.gif                
for (mli = rli.match(strli); mli.success; mli = mli.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif
InBlock.gif                    strli 
= strli.replace(mli.groups[0].tostring(), "<li>" + mli.groups[1]); 
ExpandedSubBlockEnd.gif                }
 
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<ul type=\"" + m.groups[3].tostring() + "\"><b>" + m.groups[4].tostring() + "</b>" + 
InBlock.gif                strli 
+ "</ul>"); 
ExpandedSubBlockEnd.gif            }
 
InBlock.gif
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[shadow=x][/shadow]标记#region 处[shadow=x][/shadow]标记 
InBlock.gif            
//处[shadow=x][/shadow]标记 
InBlock.gif
            r = new regex(@"(\[shadow=)(\d*@),(#*\w*@),(\d*@)\]([\s\t]*@)(\[\/shadow\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<table width=" + m.groups[2].tostring() + " style=filter:shadow(color=" + m.groups[3].tostring() + ", strength=" + m.groups[4].tostring() + ")>" + 
InBlock.gif                m.groups[
5].tostring() + "</table>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[glow=x][/glow]标记#region 处[glow=x][/glow]标记 
InBlock.gif            
//处[glow=x][/glow]标记 
InBlock.gif
            r = new regex(@"(\[glow=)(\d*@),(#*\w*@),(\d*@)\]([\s\t]*@)(\[\/glow\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<table width=" + m.groups[2].tostring() + " style=filter:glow(color=" + m.groups[3].tostring() + ", strength=" + m.groups[4].tostring() + ")>" + 
InBlock.gif                m.groups[
5].tostring() + "</table>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[center][/center]标记#region 处[center][/center]标记 
InBlock.gif            r 
= new regex(@"(\[center\])([ \s\t]*@)(\[\/center\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), "<center>" + m.groups[2].tostring() + "</center>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[img][/img]标记#region 处[img][/img]标记 
InBlock.gif            r 
= new regex(@"(\[img\])(http|https|ftp):\/\/([ \s\t]*@)(\[\/img\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), "<br><a οnfοcus=this.blur() href=/ddvipcom/" + m.groups[2].tostring() + ":/" + m.groups[3].tostring() + " target=_blank><img src=http://www.ddvip.com/" + m.groups[2].tostring() + ":/" + m.groups[3].tostring() + " border=0 alt=按此在新窗口浏览图片 οnlοad=javascript:if(screen.width-333<this.width)this.width=screen.width-333></a>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[em]标记#region 处[em]标记 
InBlock.gif            r 
= new regex(@"(\[em([\s\t]*@)\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), "<img src=http://www.ddvip.com/pic/em" + m.groups[2].tostring() + ".gif border=0 align=middle>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[flash=x][/flash]标记#region 处[flash=x][/flash]标记 
InBlock.gif            
//处[mp=x][/mp]标记 
InBlock.gif
            r = new regex(@"(\[flash=)(\d*@),(\d*@)\]([\s\t]*@)(\[\/flash\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<a href=/ddvipcom/" + m.groups[4].tostring() + " target=_blank><img src=http://www.ddvip.com/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=http://www.ddvip.com/" + 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>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[dir=x][/dir]标记#region 处[dir=x][/dir]标记 
InBlock.gif            
//处[dir=x][/dir]标记 
InBlock.gif
            r = new regex(@"(\[dir=)(\d*@),(\d*@)\]([\s\t]*@)(\[\/dir\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<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=http://www.ddvip.com/" + m.groups[4].tostring() + " pluginspage=http://www.macromedia.com/shockwave/download/ width=" + m.groups[2].tostring() + " height=" + m.groups[3].tostring() + "></embed></object>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[rm=x][/rm]标记#region 处[rm=x][/rm]标记 
InBlock.gif            
//处[rm=x][/rm]标记 
InBlock.gif
            r = new regex(@"(\[rm=)(\d*@),(\d*@)\]([\s\t]*@)(\[\/rm\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<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>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[mp=x][/mp]标记#region 处[mp=x][/mp]标记 
InBlock.gif            
//处[mp=x][/mp]标记 
InBlock.gif
            r = new regex(@"(\[mp=)(\d*@),(\d*@)\]([\s\t]*@)(\[\/mp\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<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=http://www.ddvip.com/" + m.groups[4].tostring() + " width=" + m.groups[2].tostring() + " height=" + m.groups[3].tostring() + "></embed></object>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[qt=x][/qt]标记#region 处[qt=x][/qt]标记 
InBlock.gif            
//处[qt=x][/qt]标记 
InBlock.gif
            r = new regex(@"(\[qt=)(\d*@),(\d*@)\]([\s\t]*@)(\[\/qt\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<embed src=http://www.ddvip.com/" + 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/>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
#region 处 
InBlock.gif            
//引用内容 
InBlock.gif            
//标记 
InBlock.gif
            r = new regex(@"(\[quote\])([ \s\t]*@)(\[\/quote\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                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>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[move][/move]标记#region 处[move][/move]标记 
InBlock.gif            r 
= new regex(@"(\[move\])([ \s\t]*@)(\[\/move\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), "<marquee scrollamount=3>" + m.groups[2].tostring() + "</marquee>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处标记#region 处标记 
InBlock.gif            r 
= new regex(@"(\[fly\])([ \s\t]*@)(\[\/fly\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), "<marquee width=80% behavior=alternate scrollamount=3>" + m.groups[2].tostring() + "</marquee>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
ContractedSubBlock.gifExpandedSubBlockStart.gif            
处[image][/image]标记#region 处[image][/image]标记 
InBlock.gif            
//处[image][/image]标记 
InBlock.gif
            r = new regex(@"(\[image\])([ \s\t]*@)(\[\/image\])", regexoptions.ignorecase); 
InBlock.gif            
for (m = r.match(sdetail); m.success; m = m.nextmatch()) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif
InBlock.gif                sdetail 
= sdetail.replace(m.groups[0].tostring(), 
InBlock.gif                
"<img src=http://www.ddvip.com/\"" + m.groups[2].tostring() + "\" border=0 align=middle><br>"); 
ExpandedSubBlockEnd.gif            }
 
ExpandedSubBlockEnd.gif            
#endregion
 
InBlock.gif
InBlock.gif            
return sdetail; 
ExpandedSubBlockEnd.gif        }
 
ExpandedSubBlockEnd.gif        
#endregion
 
ExpandedSubBlockEnd.gif    }
 
ExpandedBlockEnd.gif}
posted on 2006-07-13 17:30 夜隼 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/yesun/archive/2006/07/13/450064.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值