日期:2014-05-18  浏览次数:20397 次

求ASP高手帮忙把VB一个代码转换过来
VB的一个加密代码.转成ASP网页代码

Private Function JiaMi(ByVal strSource As String, ByVal Key1 As Byte, _
ByVal Key2 As Integer) As String
Dim bLowData As Byte
Dim bHigData As Byte
Dim i As Integer
Dim strEncrypt As String
Dim strChar As String
For i = 1 To Len(strSource)
'从待加(解)密字符串中取出一个字符
strChar = Mid(strSource, i, 1)
'取字符的低字节和Key1进行异或运算
bLowData = AscB(MidB(strChar, 1, 1)) Xor Key1
'取字符的高字节和K2进行异或运算
bHigData = AscB(MidB(strChar, 2, 1)) Xor Key2
'将运算后的数据合成新的字符
If Len(Hex(bLowData)) = 1 Then
strEncrypt = strEncrypt & "0" & Hex(bLowData)
Else
strEncrypt = strEncrypt & Hex(bLowData)
End If
If Len(Hex(bHigData)) = 1 Then
strEncrypt = strEncrypt & "0" & Hex(bHigData)
Else
strEncrypt = strEncrypt & Hex(bHigData)
End If
Next
JiaMi = strEncrypt
End Function

------解决方案--------------------
http://www.developerfusion.com/tools/convert/csharp-to-vb/
------解决方案--------------------
探讨

http://www.developerfusion.com/tools/convert/csharp-to-vb/

------解决方案--------------------
探讨

引用:

在asp网页上是错误的.

什么意思?转换的C#代码啊

------解决方案--------------------
探讨

不是转成ASP.net
是转成asp网页