byte array to string 
Author Message
 byte array to string

Hi,
I am reading the POST data from Request.binaryread() method. Could anyone
please tell me, how can I convert its returned byte array to a text string ?

Thanks.
Imran Badr.



Sat, 14 Dec 2002 03:00:00 GMT  
 byte array to string
->
Dim MyString
For N=0 To UBound(MyByteArray)
 MyString = MyString &ChrW(AscW(Chr(AscB(MidB(MyByteArray, N, 1)))))
Next
....
<-

--
Dominic



Sat, 14 Dec 2002 03:00:00 GMT  
 byte array to string
Thanks for the code. But I am getting "Invalid procedure call or argument:
MidB" when I do the following:

   count = Request.TotalBytes
   binRead = Request.BinaryRead(count)

   Dim MyString
   For N=0 To UBound(binRead)
   MyString = MyString&ChrW(AscW(Chr(AscB(MidB(binRead, N, 1)))))
   Next

Please advice what am I doing wrong.

Thankyou very much.
Imran Badr.


Quote:
> ->
> Dim MyString
> For N=0 To UBound(MyByteArray)
>  MyString = MyString &ChrW(AscW(Chr(AscB(MidB(MyByteArray, N, 1)))))
> Next
> ....
> <-

> --
> Dominic



Sat, 14 Dec 2002 03:00:00 GMT  
 byte array to string
->
...
MyString = MyString &ChrW(AscW(Chr(AscB(MidB(binRead, N, 1)))))
...
<-

Also try modifying the number of recusions by more or less one. For example:

->
For N=0 To UBound(binRead) - 1
<-

Sometimes you end up one over...

--
Dominic



Sat, 14 Dec 2002 03:00:00 GMT  
 byte array to string
Thankyou very much Dominic! I really appreciate your help!
Best regards,
Imran Badr.


Quote:
> ->
> ...
> MyString = MyString &ChrW(AscW(Chr(AscB(MidB(binRead, N, 1)))))
> ...
> <-

> Also try modifying the number of recusions by more or less one. For
example:

> ->
> For N=0 To UBound(binRead) - 1
> <-

> Sometimes you end up one over...

> --
> Dominic



Sat, 14 Dec 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. convert Byte array to string and vice veras

2. Byte Array to String and Vice Versa?

3. How to convert a byte array to string ?

4. Converting byte array to string?

5. Assign byte array to string?

6. Byte Arrays and Strings

7. Convert BYTE array to String

8. Convert Byte Array to String

9. How to convert a byte array to string ?

10. Byte array to string

11. How to convert a byte array to string ?

12. byte array to string

 

 
Powered by phpBB® Forum Software