encoder.GetString() help

Discussion in 'ASP .Net' started by iMonkey, Jul 31, 2003.

  1. iMonkey

    iMonkey Guest

    I have tried the following to convert an encrypted byte() into a string to
    write it to a database:
    Dim encoding as new UTF8Encoding()
    Dim EncNum as String = encoding.GetString(
    encoder.GetString(cypherText) )

    CypherText being the string that has just been encrypted which is now in
    stored using Byte() I believe

    When I run this I get the following error:
    BC30311: Value of type 'String' cannot be converted to '1-dimensional
    array of Byte'.

    I dont have any idea what I should try now as I have done nothing like this
    before, any help will be much appreciated!

    For reference purposes and if anyone wants it the code I used to encrypt my
    string is located here:
    http://aspalliance.com/cookbook/ViewSource.aspx?Filename=Recipe1509vb.aspx&RecipeType=ASPX

    I have the decryption piece of code on a different page, this seems to be
    working but can test it properly as it says the string that I have written
    to the dtabase is not the correct length (This was before I tried to convert
    it from Byte to string)
     
    iMonkey, Jul 31, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nakhi

    datareader.getstring(0) error

    Nakhi, Jul 14, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    2,126
    Nakhi
    Jul 15, 2003
  2. Nakhi
    Replies:
    0
    Views:
    479
    Nakhi
    Jul 15, 2003
  3. DaveF

    GetString for .net

    DaveF, Jun 11, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,634
    John Saunders
    Jun 11, 2004
  4. DaveF

    GetString .net equivelant??

    DaveF, Jun 14, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    414
    DaveF
    Jun 14, 2004
  5. =?Utf-8?B?TGVlIFdhbHRlcnM=?=

    Find size of GetString in DataReader (vb.net)

    =?Utf-8?B?TGVlIFdhbHRlcnM=?=, Dec 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    5,046
    =?Utf-8?B?TGVlIFdhbHRlcnM=?=
    Jan 4, 2005
Loading...

Share This Page