• 关于String 和 Base64 之间的互转 比较简单!


      public static String EncryptBase64Code(String text)
            
    {
                Byte[] bufin 
    = System.Text.ASCIIEncoding.UTF8.GetBytes(text);
                String result 
    = Convert.ToBase64String(bufin, 0, bufin.Length);
                
    return result;
            }


            
    public static String DecryptBase64Code(String text)
            
    {
                
    try
                
    {
                    Byte[] bufout 
    = Convert.FromBase64String(text);
                    String result 
    = System.Text.ASCIIEncoding.UTF8.GetString(bufout);
                
    return result;
                }

                
    catch
                
    {
                    
    return text;
                }

            }
     
  • 相关阅读:
    Excel sheet Column Title
    Add Two Numbers
    Add Binary
    Excel Sheet Column Number
    Lowest Common Ancestor of a Binary Search Tree
    Invert Binary Tree
    Move Zeroes
    Contains Duplicate
    Maximum Depth of Binary Tree
    Java实现二叉树的构建与遍历
  • 原文地址:https://www.cnblogs.com/SUNBOY/p/526037.html
Copyright © 2020-2023  润新知