While that will indeed convert an int into an array of bytes, I'm not
sure it's likely to be the format the OP is looking for - I suspect
BitConverter is more likely to be useful.
Yes, it was useful. But again i got one problem of using this UTF8
1. I have one string that i'm encrypting and getiing byte[]
but in SQL data base i have the field type varchar for that one i converting
that
byte[] to string and storing database. when I'm going to Decrypt that string
i'm getting length problem.
Yes, it was useful. But again i got one problem of using this UTF8
1. I have one string that i'm encrypting and getiing byte[]
but in SQL data base i have the field type varchar for that one i converting
that
byte[] to string and storing database. when I'm going to Decrypt that string
i'm getting length problem.
Are you trying to convert the byte[] to a string just by using
Encoding.UTF8.GetString()? You shouldn't - you should use base 64 to
convert *arbitrary* binary data to a string and back again. See
Convert.ToBase64String and Convert.FromBase64String.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.