ASP Unescape加密/编码,ASP Unescape加密,ASP Unescape编码:

<%
Function vbEscape(psString)
    Dim nTemp, sTemp, sTempChar, nTempAsc
    For nTemp =1 To Len(psString)
        sTempChar =Mid(psString, nTemp, 1)
        nTempAsc =Ascw(sTempChar)
        If (nTempAsc >=48 and nTempAsc <=57) or (nTempAsc >=65 and nTempAsc <=90) or (nTempAsc >=97 and nTempAsc <=122) or Instr("@*_+-./", sTempChar) >0 Then
            sTemp =sTemp & sTempChar
        ElseIf nTempAsc >0 and nTempAsc <16 Then
            sTemp =sTemp & "%0" & Hex(nTempAsc)
        ElseIf nTempAsc >=16 and nTempAsc <256 Then
            sTemp =sTemp & "%" & Hex(nTempAsc)
        Else
            sTemp =sTemp & "%u" & Hex(nTempAsc)
        End If
    Next
    vbEscape =sTemp
End Function
%>

ASP Unescape解密/解码,ASP Unescape解密,ASP Unescape解码:

<%
Function vbUnEscape(psString)
    Dim nTemp, sTemp, sTempChar
    sTemp =""
    For nTemp =1 To Len(psString)
        sTempChar =Mid(psString, nTemp, 1)
        If Mid(psString, nTemp, 2) ="%u" and nTemp <=Len(psString) -5 Then
            If IsNumeric("&H" & Mid(psString, nTemp +2,4)) Then
                sTemp =sTemp & Chrw(CInt("&H" & Mid(psString, nTemp +2, 4)))
                nTemp = nTemp +5
            Else
                sTemp =sTemp & sTempChar
            End If
        ElseIf sTempChar ="%" and nTemp <=Len(psString) -2 Then
            If IsNumeric("&H" & Mid(psString, nTemp +1, 2)) Then
                sTemp =sTemp & CHRW(CInt("&H" & Mid(psString, nTemp +1, 2)))
                nTemp =nTemp +2
            Else
                sTemp =sTemp & c
            End If
        Else
            sTemp =sTemp & sTempChar
        End If
    Next
    vbUnEscape =sTemp
End Function
%>