The Microsoft .net framework supports the base64 encoding from the bases. The encoding can be done with the System.Convert class. To convert a simple UTF-8 coded text into a Base64 string in C# you can use this:

The decoding - like before - can be done with calling a method from the Convert class. The only problem with this, that is gives back a byte array as a result. It should be converted to a UTF-8 string with the System.Text namespace's Decoder class.