当前位置: 首页 > 图文教程 > 网络编程 > ASP > asp中向文本框输出数据原样式的函数

ASP
ASP 3.0高级编程(十一)
ASP 3.0高级编程(十三)
ASP 3.0高级编程(十四)
ASP 3.0高级编程(十五)
ASP 3.0高级编程(十六)
ASP 3.0高级编程(十七)
ASP 3.0高级编程(十八)
ASP 3.0高级编程(十九)
ASP 3.0高级编程(二十)
ASP 3.0高级编程(二十一)
ASP 3.0高级编程(二十二)
ASP 3.0高级编程(二十三)
ASP+配置 — ASP+配置概念(二)
ASP+配置 — ASP+配置概念(三)
ASP+全新接触(1)
ASP+全新接触(2)
ASP+全新接触(3)
ASP+全新接触(4)
asp+语法教程(一)前言
asp+语法教程(二)书写我们的第一个asp+文件

ASP 中的 asp中向文本框输出数据原样式的函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 196 ::
收藏到网摘: n/a

从数据库输出信息时有转换函数,可以将回车空格按原样式输出。这段代码可向文本框原样输出代码。
复制代码 代码如下:

Function cc_f_textarea_html_encode(cc_f_t_h_e_str)
If Not IsNull(cc_f_t_h_e_str) And cc_f_t_h_e_str <> "" Then
cc_f_t_h_e_str = Replace(cc_f_t_h_e_str, ">", ">")
cc_f_t_h_e_str = Replace(cc_f_t_h_e_str, "<", "<")
cc_f_t_h_e_str = Replace(cc_f_t_h_e_str, CHR(13), "")
cc_f_t_h_e_str = Replace(cc_f_t_h_e_str, CHR(10) & CHR(10), vbCrLf)
cc_f_t_h_e_str = Replace(cc_f_t_h_e_str, CHR(10), vbCrLf)
cc_f_textarea_html_encode = cc_f_t_h_e_str
End If
End Function