Since you are using string, did you check account for unicode characters?
If your string is "ABC", when converted into bytearray it's 0, 65, 0, 66, 0, 67. Remember unicode is 2-byte each.
Note: I arbitrarily used a machine encoding of MSB-LSB. I do not remember how windows encodes them, so the string may be 65, 0, 66, 0, 67, 0. You should determine this yourself.
Also you may find it easier to change datetime variable directly into 8 byte byte-arrary and by-pass the whole unicode/string conversion process if both your server and client are written with .NET
|