Public string Texttohtml (string chr)
{
If (chr = null) return "";
Chr = chr. Replace ("<", "& lt ");
Chr = chr. Replace (">", "& gt ");
Chr = chr. Replace ("\ n", "<br/> ");
// Process [URL] [/URL]
Chr = Regex. Replace (chr, @ "\ [URL \] (? <X> [^ \] *) \ [\/URL \] ", @" <a href = $1 target = _ blank> $1 </a> ", regexOptions. ignoreCase );
// Process [URL = x] [/URL]
Chr = Regex. Replace (chr, @ "\ [URL = (? <X> [^ \] *) \] (? <Y> [^ \] *) \ [\/URL \] ", @" <a href = $1 target = _ blank> $2 </a> ", regexOptions. ignoreCase );
// Process [EMAIL] [/EMAIL]
Chr = Regex. Replace (chr, @ "\ [EMAIL \] (? <X> [^ \] *) \ [\/EMAIL \] ", @ " <a href =" "mailto: $1" "> $1 </A>", RegexOptions. ignoreCase );
// Process [EMAIL = x] [/EMAIL]
Chr = Regex. Replace (chr, @ "\ [EMAIL = (\ S + \ @. [^ \ [] *) \] (? <Y> [^ \] *) \ [\/EMAIL \] ", @ " <a href =" "mailto: $1 "" TARGET = _ blank> $2 </A> ", RegexOptions. ignoreCase );
// Handle mood icons
EmotPath = "BBS/Skins/Default/emot /";
Chr = Regex. replace (chr, @ "\ [em (. [^ \ [] *) \] ", @" ", RegexOptions. ignoreCase );
// Process [div] [/div]
Chr = Regex. replace (chr, @ "\ [center \] (. [^ \ [] *) \ [\/center \] ", @" <div align = center> $1 </div> ", RegexOptions. ignoreCase );
// Process [fly] [/fly]
Chr = Regex. replace (chr, @ "\ [fly \] (. [^ \ [] *) \ [\/fly \] ", @" <marquee width = 90% behavior = alternate scrollamount = 3> $1 </marquee> ", RegexOptions. ignoreCase );
// Process [move] [/move]
Chr = Regex. replace (chr, @ "\ [move \] (. [^ \ [] *) \ [\/move \] ", @" <marquee scrollamount = 3> $1 </marquee> ", RegexOptions. ignoreCase );
// Process [SHADOW] [/SHADOW]
Chr = Regex. replace (chr, @ "\ [SHADOW = * ([0-9] *), * (# * [a-z0-9] *), * ([0-9] *) \] (. [^ \ [] *) \ [\/SHADOW \] ", @" <div style = "" width: $ 1px; filter: shadow (color = $2, strength = $3) ""> $4 </div> ", RegexOptions. ignoreCase );
// Process [GLOW] [/GLOW]
Chr = Regex. replace (chr, @ "\ [GLOW = * ([0-9] *), * (# * [a-z0-9] *), * ([0-9] *) \] (. [^ \ [] *) \ [\/GLOW \] ", @" <div style = "" width: $ 1px; filter: glow (color = $2, strength = $3) ""> $4 </div> ", RegexOptions. ignoreCase );
// Process [B] [/B]
Chr = Regex. Replace (chr, @ "\ [B \] (? <X> [^ \] *) \ [/B \] ", @" <B> $1 </B> ", RegexOptions. IgnoreCase );
// Process [I] [/I]
Chr = Regex. Replace (chr, @ "\ [I \] (? <X> [^ \] *) \ [/I \] ", @" <I> $1 </I> ", RegexOptions. IgnoreCase );
// Process [u] [/u]
Chr = Regex. Replace (chr, @ "\ [u \] (? <X> [^ \] *) \ [/u \] ", @" <u> $1 </u> ", RegexOptions. IgnoreCase );
// Process [center] [/center]
Chr = Regex. Replace (chr, @ "\ [center \] (? <X> [^ \] *) \ [\/center \] ", @" <div align = center> $1 </div> ", RegexOptions. IgnoreCase );
Chr = Regex. Replace (chr, @ "\ [list \] (? <X> [^ \] *) \ [/list \] ", @" <ul> $1 </ul> ", RegexOptions. IgnoreCase );
Chr = Regex. Replace (chr, @ "\ [list = 1 \] (? <X> [^ \] *) \ [/list \] ", @" <ol type = 1> $1 </ol id = 1> ", RegexOptions. ignoreCase );
Chr = Regex. Replace (chr, @ "\ [list = a \] (? <X> [^ \] *) \ [/list \] ", @" <ol type = a> $1 </ol id = a> ", RegexOptions. ignoreCase );
Chr = Regex. Replace (chr, @ "\ [\ * \] (? <X> [^ \] *) \ [/\ * \] ", @" <li> $1 </li> ", RegexOptions. IgnoreCase );
Chr = Regex. Replace (chr, @ "\ [quote] (? <X>. *) \ [/quote] ", @ "<center> -- reference -- <table border = '1' width = '000000' cellpadding = '10' cellspacing = '0'> <tr> <td> $1 </td> </tr> </table> </center> ", regexOptions. ignoreCase );
// Process [code] [/code]
Chr = Regex. Replace (chr, @ "\ [code \] (? <X> [^ \] *) \ [/code \] ", @ "<table width =" 100% "" border = "" 0 "" cellspacing = "" 0 "" cellpadding = "6"> <td> <B> the content is the program code: </B> <br/> $1 </td> </table> ", RegexOptions. ignoreCase );
// Process [HTML] [/HTML]
Chr = Regex. Replace (chr, @ "\ [HTML \] (? <X> [^ \] *) \ [\/HTML \] ", @" table