Lbnr. Text = tourl (Dr ["remark"]. tostring (); // reference specific content displayed in the text of a control
/// <Summary>
/// Automatically split the text accepted by the label and filter out redundant or malicious characters
/// </Summary>
/// <Param name = "inputstring"> </param>
/// <Returns> </returns>
Public static string convertstr (string inputstring) // define
{
String retval = inputstring;
Retval = retval. Replace ("&", "& amp;"); // filter characters &
// Retval = retval. Replace ("\" "," & quot; "); // filter character \
// Retval = retval. Replace ("<", "& lt;"); // filter characters <
// Retval = retval. Replace (">", "& gt;"); // filter characters>
// Retval = retval. Replace ("", "& nbsp;"); // filter character spaces ""
// Retval = retval. Replace ("", "& nbsp;"); // filter the character """"
// Retval = retval. Replace ("\ t", "& nbsp;"); // filter character \ t
Retval = retval. Replace ("\ r", "<br>"); // filter character \ r <br>
Return retval;
}
Public static string tourl (string inputstring) // reference and replace
{
String retval = inputstring;
Retval = convertstr (retval );
Return retval;
// Retval = RegEx. Replace (retval, @ "\ [url] (? <X> [^ \] *) \ [/url] ", @ "<a href =" "$1" "target =" "_ blank" "> $1 </a>", regexoptions. ignorecase );
// Retval = RegEx. Replace (retval, @ "\ [Flash = (? <Width> \ D + ),(? <Height> \ D +)] (? <X> [^ \] *) \ [/flash] ", @ "<embed src =" "$3" "width =" "$ {width}" "Height =" "$ {height}"> </embed> ", regexoptions. ignorecase );
// Retval = RegEx. Replace (retval, @ "\ [Flash] (? <X> [^ \] *) \ [/flash] ", @" <embed src = "" $1 "> </embed>", regexoptions. ignorecase );
// Return RegEx. Replace (retval, @ "\ [img] (? <X> [^ \] *) \ [/img] ", @ "<a href =" "$1" "target =" "_ blank" "> screen. width-220) This. width = screen. width-220 "" border = 1> </a> ", regexoptions. ignorecase );
}