从数据库中读取出来的文章如何控制格式,读出来的没有换行等样式

来源:百度知道 编辑:UC知道 时间:2024/05/26 15:28:47
从ACCESS中读取的文章,然后显示在页面上,可是显示的内容没有格式,不好看,如何控制格式呢

Function TextEncode(ByVal Str)
If Trim(Str) = "" Or IsNull(Str) Then TextEncode = "": Exit Function
Str = Replace(Str, ">", ">")
Str = Replace(Str, "<", "<")
Str = Replace(Str, Chr(32), " ")
Str = Replace(Str, Chr(9), " ")
Str = Replace(Str, Chr(34), """)
Str = Replace(Str, Chr(39), "'")
Str = Replace(Str, Chr(13), "")
Str = Replace(Str, Chr(10), "<br />")
TextEncode = Str
End Function

输出文章内容
Response.Write TextEncode(文章内容字段)