日期:2014-05-16 浏览次数:20959 次
public static string TextOutputHtml(string str)
{
if (str.Equals(null))
{
return "";
}
string outputString;
outputString = HttpUtility.HtmlEncode(str);
outputString = str.Replace("\n", @"</p><p style=""text-indent:2em;text-align:left;"">");
outputString = @"<p style=""text-indent:2em;text-align:left;"">" + outputString + @"</p>";
return outputString;
}
function TextOutputHtml(str)
if isNull(str) then
TextOutputHtml = ""
exit function
end if
dim outputString;
outputString = Server.HTMLEncode(str);
outputString = Replace(outputString, "\n", "</p><p style=""text-indent:2em;text-align:left;"">");
outputString = "<p style=""text-indent:2em;text-align:left;"">" & outputString & "</p>";
TextOutputHtml = outputString;
end function