Being one of the zillion programmers jumping into rough waters of XML, XSLT and AJAX (combined with ASP back-end) I had my own share of "reinventing the wheel" experience. Hopefully by documenting some of these reinventions, I'll save you a few minutes of hair-pulling.
This is yet another of slightly undocumented ASP features - you can find a lot of examples telling you how to read and write binary data (with, among other things, Response.binaryWrite or ADODB_recordset("blob").value), but when you try to manipulate individual bytes (I had to compute MD5 hash), uncle Google or Microsoft search gives you nothing. The trick is (as always) very simple: you treat variant byte array as string, using regular string functions (like Len, Mid or Asc). However, due to Unicode support in VBScript, you have to use their byte versions. So, to dump the variant byte array, use this code:
For I = 1 to LenB(varArray) Response.Write AscB(MidB(varArray,I,1)) Next
1 comment:
THANK YOU !!!
That solved my problems.
Post a Comment