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
views:
113answers:
2You 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.
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