Convert long to byte array to string representation
Posted on 2011-04-20
I'm working with a 3rd party com method with returns a "dword" which is 32 bits. The first 16 bits contains info, and the rest is empty.
Using c#, I'm trying to get the returned value (which I think is a long?), convert that value to a byte array, and then get the string representation of the whole lot.
What I'm hoping to end up with is something like this:
"0000 1011 0000 0000" - without the spaces.
Each bit represents an error message and this is why I need to shift through the string values at specific indexes etc.
Can someone please help with this, I'm getting nowhere fast.
Thank you in advance,