经典ASP Cookie身份验证代码不起作用

时间:2018-03-26 15:09:28

标签: vbscript asp-classic

我从我的某个供应商处收到了以下Cookie验证码。

据说这是经典的ASP代码,但是当我将它插入我的经典asp程序时,它会因500服务器错误而崩溃。

以下代码是真正经典的asp吗?谁能告诉我为什么这段代码在经典的asp中不起作用?

谢谢!

萨尔

=========================

Function DeCrypt(ByVal strEncrypted As String, ByVal strKey As String) As String 
    ' cookie data is stored urlencoded and must be decoded before processing
    strEncrypted = HttpUtility.UrlDecode(strEncrypted)

    Dim iKeyChar As String
    Dim iStringChar As String
    Dim iDeCryptChar As String
    Dim strDecrypted As String = String.Empty

    For i As Integer = 0 To strEncrypted.Length - 1
        iKeyChar = Asc(strKey(i)).ToString()
        iStringChar = Asc(strEncrypted(i)).ToString()
        iDeCryptChar = iKeyChar Xor iStringChar
        strDecrypted &= Chr(iDeCryptChar)
    Next

    Return strDecrypted
End Function

1 个答案:

答案 0 :(得分:1)

不,它看起来像vb.net代码。转换过来很容易:

if (this.props.total != prevProps.total){this.props.dispatch(change('mainForm', 'total', total));}