예제 #1
0
 /// <summary>
 /// 压缩字编码符串
 /// </summary>
 /// <param name="input">待压缩的编码字符串</param>
 /// <returns>压缩后的字符串</returns>
 public static string CompressEncoding(string input)
 {
     byte[] inputBytes = System.Text.Encoding.Default.GetBytes(input);
     byte[] result     = CompressEx.CompressBytes(inputBytes);
     return(Convert.ToBase64String(result));
 }
예제 #2
0
 /// <summary>
 /// 解压缩编码字符串
 /// </summary>
 /// <param name="input">待解压缩的编码字符串</param>
 /// <returns>解压缩后的字符串</returns>
 public static string DecompressEncoding(string input)
 {
     byte[] inputBytes   = Convert.FromBase64String(input);
     byte[] depressBytes = CompressEx.DecompressBytes(inputBytes);
     return(System.Text.Encoding.Default.GetString(depressBytes));
 }