Converts string to a base64 byte[]. - CSharp System

CSharp examples for System:String Base64

Description

Converts string to a base64 byte[].

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*w  w w .  ja  v  a 2 s . c om*/

public class Main{
        /// <summary>
        ///     Converts string to a base64 byte[].
        /// </summary>
        /// <param name="inputString"></param>
        /// <exception cref="System.ArgumentNullException"></exception>
        /// <exception cref="System.FormatException"></exception>
        /// <returns></returns>
        public static byte[] StringToBase64ByteArray(string inputString)
        {
            return Convert.FromBase64String(inputString);
        }
}

Related Tutorials