Public String texttohtml (string CHR)
{
If (CHR = NULL)
Return "";
CHR = CHR. Replace ("<", "& lt ");
CHR = CHR. Replace (">", "& gt ");
CHR = CHR. Replace ("\ n", "<br/> ");
CHR = RegEx. Replace (CHR, @ "\ [url = (? <X> [^ \] *) \] (? <Y> [^ \] *) \ [/url \] ", @" <a href = $1 target = _ blank> $2 </a> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [url \] (? <X> [^ \] *) \ [/url \] ", @" <a href = $1 target = _ blank> $1 </a> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [email = (? <X> [^ \] *) \] (? <Y> [^ \] *) \ [/Email \] ", @" <a href = $1> $2 </a> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [email \] (? <X> [^ \] *) \ [/Email \] ", @" <a href = $1> $1 </a> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [Flash] (? <X> [^ \] *) \ [/flash] ", @" Object codebase = http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 classid = CLSID: d27CDB6E-AE6D-11cf-96B8-444553540000 width = 500 Height = 400> <Param name = movie value = "" $1 ""> <Param name = Quality value = high> <embed src = "" $1" "Quality = high pluginspage = 'HTTP: // www.macromedia.com/shockwave/download/index.cgi? P1_prod_version = shockwaveflash 'Type = 'application/X-Shockwave-flash' width = 500 Height = 400> $1 </embed> </object ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [img] (? <X> [^ \] *) \ [/img] ", @" ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [color = (? <X> [^ \] *) \] (? <Y> [^ \] *) \ [/color \] ", @" <font color = $1> $2 </font> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [face = (? <X> [^ \] *) \] (? <Y> [^ \] *) \ [/face \] ", @" <font face = $1> $2 </font> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [size = 1 \] (? <X> [^ \] *) \ [/size \] ", @" <font size = 1> $1 </font> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [size = 2 \] (? <X> [^ \] *) \ [/size \] ", @" <font size = 2> $1 </font> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [size = 3 \] (? <X> [^ \] *) \ [/size \] ", @" <font size = 3> $1 </font> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [size = 4 \] (? <X> [^ \] *) \ [/size \] ", @" <font size = 4> $1 </font> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [align = (? <X> [^ \] *) \] (? <Y> [^ \] *) \ [/align \] ", @" <align = $1> $2 </align> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [Fly ](? <X> [^ \] *) \ [/Fly] ", @" <marquee width = 90% behavior = alternate scrollamount = 3> $1 </marquee> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [Move] (? <X> [^ \] *) \ [/Move] ", @" <marquee scrollamount = 3> $1 </marquee> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [glow = (? <X> [^ \] *), (? <Y> [^ \] *), (? <Z> [^ \] *) \] (? <W> [^ \] *) \ [/glow \] ", @" <Table width = $1 style = 'filter: glow (color = $2, strength = $3) '> $4 </table> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [shadow = (? <X> [^ \] *), (? <Y> [^ \] *), (? <Z> [^ \] *) \] (? <W> [^ \] *) \ [/shadow \] ", @" <Table width = $1 style = 'filter: Shadow (color = $2, strength = $3) '> $4 </table> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [B \] (? <X> [^ \] *) \ [/B \] ", @" <B> $1 </B> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [I \] (? <X> [^ \] *) \ [/I \] ", @" <I> $1 </I> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [U \] (? <X> [^ \] *) \ [/u \] ", @" <u> $1 </u> ", regexoptions. ignorecase );
CHR = RegEx. Replace (CHR, @ "\ [Code \] (? <X> [^ \] *) \ [/Code \] ", @" <PRE id = code> <font size = 1 face = 'verdana, arial 'id = code> $1 </font id = code> </PRE id = code> ", 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 );
Return (CHR );
}
Public String htmltotext (string CHR)
{
If (CHR = NULL)
Return "";
CHR = CHR. Replace ("'","''");
Return (CHR );
}