网络安全

位置:IT落伍者 >> 网络安全 >> 浏览文章

asp html代码转安全ascii代码


发布日期:2023年09月10日
 
asp html代码转安全ascii代码

function DoTrimProperly(str nNamedFormat properly pointed points)
dim strRet
strRet = ServerHTMLEncode(str)
strRet = replace(strRet vbcrlf"<br>")
strRet = replace(strRet vbtab"")
if (LEN(strRet) > nNamedFormat) Then
strRet = LEFT(strRet nNamedFormat)
if (properly = ) Then
Dim TempArray
TempArray = split(strRet " ")
Dim n
strRet = ""
for n = to Ubound(TempArray)
strRet = strRet & " " & TempArray(n)
next
End if
if (pointed = ) Then
strRet = strRet & points
End if
End if
DoTrimProperly = strRet
End Function

Function FormatStr(String)
on Error resume next
String = Replace(String CHR() "")
String = Replace(String "<" "&lt;")
String = Replace(String ">" "&gt;")
String = Replace(String CHR() & CHR() "<BR><BR>")
String = Replace(String CHR() "<BR>")
FormatStr = String
End Function


Function FormatStr(String)
on Error resume next
String = Replace(String " " "&nbsp;")
String = Replace(String CHR() "&nbsp")
String = Replace(String CHR() & CHR() "<BR><BR>")
String = Replace(String CHR() "<BR>")
String = Replace(String "<" "&lt;")
String = Replace(String ">" "&gt;")
FormatStr = String
End Function

上一篇:防止非法盗链本站图片方法

下一篇:asp 全面安全数据连接代码