I am looking for a way to pass a byte array from a c# COM object to IIS/ASP (not .NET). I was going to pass it using strings, but while ASP handles binary data in strings without problems, C# does not. This means I cannot expect a byte array converted to string and passed to ASP to be identical to the original array. Also, when having the array in ASP, I need to send it unchanged as a response (Response.Write).
I found this SO answer - How to correctly marshal VB-Script arrays to and from a COM component written in C# explaining how to pass arrays, but it isn't clear to me how I am supposed to pass a byte array and how to assemble the array to a string in ASP.
Any pointers? I already have the COM object and can pass data (strings, int, etc) back and forth. The byte array part eludes me.
Edit: This is what I use now (and what does not work at all):
[DispId(1003)]
byte[] arrayOut { set; get; }