Ejemplo n.º 1
0
 /// <summary>
 /// 将对象转换成base64位的字符串
 /// </summary>
 /// <typeparam name="T">对象类型</typeparam>
 /// <param name="t">对象</param>
 /// <returns></returns>
 public static string EncryptBase64<T>(T t) where T : class
 {
     string result = string.Empty;
     if (t == null) return result;
     byte[] bytes = SerializerHelper.ConverToBytes(t);
     result = Convert.ToBase64String(bytes, Base64FormattingOptions.None);
     return result;
 }