Problem on the conversion between byte array and string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stephanie Yao via .NET 247

    #1

    Problem on the conversion between byte array and string

    Hi, now I've done some practice on the encryption and decryption.

    1, I get a encryption result, and show it in the textbox as a string, like this:
    string regID = Encoding.UTF8.G etString(regByt es);
    this.tbRID.Text = regID;\
    here the length of the regBytes is 32;

    2, I want to decrypt the string in another function, so I did this:
    string regID = this.tbRID.Text ;
    byte[] regBytes = Encoding.UTF8.G etBytes(regID);
    But here the length of the regBytes is 20, so can anyone tell me how to get the missing data?

    --------------------------------
    From: Stephanie Yao

    -----------------------
    Posted by a user from .NET 247 (http://www.dotnet247.com/)

    <Id>w2AL8KN/90WdMYCd99iFzg= =</Id>
Working...