tags:

views:

113

answers:

2

I want to make a Software which decodes Base64-encoded text strings and vice versa. Any help provided on the topic with coding in Visual Basic will help me a lot. Thank you. Note:-c# language can also be implemented

+2  A: 

You need to call Convert.ToBase64String and Convert.FromBase64String.

These methods convert byte arrays to and from Base64.

If you want to encode a string in Base64, you'll need to convert it to a byte array by calling Encoding.Unicode.GetBytes(str) and Encoding.Unicode.GetString(bytes). (In the System.Text namespace)

Note that Base64 should never be used for encryption, except to convert a byte array that was already encrypted into a string.

If you want to encrypt data, use the RijndaelManaged class.

SLaks
A: 

You can use Convert.FromBase64String. http://msdn.microsoft.com/en-us/library/system.convert.frombase64string.aspx http://msdn.microsoft.com/en-us/library/dhx0d524.aspx.

If you really want to know how to do it yourself - here are instructions for Java which you can reverse for decode. http://www.wikihow.com/Encode-a-String-to-Base64-With-Java

Dmitry
Do not re-invent the wheel. Note that there are also `ToBase64Transform` and `FromBase64Transform` classes.
SLaks