Exemple #1
0
 public string BASE64_Convert(bool action, string strData)
 {
     if (action)
     {
         return(BASE64_Main.DecodeS(strData, "UTF-8"));
     }
     else
     {
         return(BASE64_Main.EncryptS(strData, "UTF-8"));
     }
 }
Exemple #2
0
        static void BASE64_TEST()
        {
            string str    = "简体中文\n繁體中文\nカタカナ\nひらがな\nEnglish\n12345";
            string strEnc = BASE64_Main.EncryptS(str, "GBK");

            Console.Out.WriteLine("GBK: " + strEnc);
            Console.Out.WriteLine(BASE64_Main.DecodeS(strEnc, "GBK"));
            strEnc = BASE64_Main.EncryptS(str, 65001);
            Console.Out.WriteLine("UTF-8: " + strEnc);
            Console.Out.WriteLine(BASE64_Main.DecodeS(strEnc, 65001));
            strEnc = BASE64_Main.EncryptS(str, "UTF-16");
            Console.Out.WriteLine("UTF-16LE: " + strEnc);
            Console.Out.WriteLine(BASE64_Main.DecodeS(strEnc, "UTF-16"));
        }