In ASP, you can use templates to convert from dynamic web pages to static web pages. In fact, static web pages can be generated based on templates through fsofile operations. The following is the function of HTML code conversion for asp compiled by the editor of the Error New Technology Channel. Let's go to the following to learn more!
'*********************************
'Function: HTMLEncode(reString)
'Parameter: reString, string to be encoded
'Author: Alixi
'Date: 2007/7/15
'Description: Convert HTML code
'Example: HTMLEncode("
Welcome to visit
Alixi
")
'*********************************
Function HTMLEncode(reString)
Dim Str:Str=reString
If Not IsNull(Str) Then
Str = UnCheckStr(Str)
Str = Replace(Str, "&", "&")
Str = Replace(Str, ">", ">")
Str = Replace(Str, "<", "<")
Str = Replace(Str, CHR(32), " ")
Str = Replace(Str, CHR(9), " ")
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), "
")
HTMLEncode = Str
End If
End Function
'Inverse conversion HTML code
Function HTMLDecode(reString)
Dim Str:Str=reString
If Not IsNull(Str) Then
Str = Replace(Str, "&", "&")
Str = Replace(Str, ">", ">")
Str = Replace(Str, "<", "<")
Str = Replace(Str, " ", CHR(32))
Str = Replace(Str, " ", CHR(9))
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))
HTMLDecode = Str
End If
End Function
%>
The above is the function of asp to implement HTML code conversion. For more content, please continue to pay attention to other related articles of the WoXin Technology Channel!