A
abarberis
I am using the following code to convert a byte array in vbscript which
is passed to a web service:
Function ByteArray2Text(varByteArray)
'Convert byte array into a string with VBScript
'60kb = 2 seconds, 100kb = 5 seconds, 200kb = 25 seconds
Dim strBuffer, lngCounter
strData = ""
strBuffer = ""
For lngCounter = 0 to UBound(varByteArray)
strBuffer = strBuffer & Chr(255 And Ascb(Midb(varByteArray,lngCounter
+ 1, 1)))
'Keep strBuffer at 1k bytes maximum
If lngCounter Mod 1000 = 0 Then
strData = strData & strBuffer
strBuffer = ""
End If
Next
ByteArray2Text = strData & strBuffer
End Function
I need to decode it with .NET. It seems that they are different because
I am getting invalid data when I decode using
System.Convert.FromBase64String.
Any ideas? I'm stuck!
Thanks
Alex
is passed to a web service:
Function ByteArray2Text(varByteArray)
'Convert byte array into a string with VBScript
'60kb = 2 seconds, 100kb = 5 seconds, 200kb = 25 seconds
Dim strBuffer, lngCounter
strData = ""
strBuffer = ""
For lngCounter = 0 to UBound(varByteArray)
strBuffer = strBuffer & Chr(255 And Ascb(Midb(varByteArray,lngCounter
+ 1, 1)))
'Keep strBuffer at 1k bytes maximum
If lngCounter Mod 1000 = 0 Then
strData = strData & strBuffer
strBuffer = ""
End If
Next
ByteArray2Text = strData & strBuffer
End Function
I need to decode it with .NET. It seems that they are different because
I am getting invalid data when I decode using
System.Convert.FromBase64String.
Any ideas? I'm stuck!
Thanks
Alex