public static Image FromDatabase(string value) { if (value == null) { return(null); } var bytes = ByteaConverter.FromDatabase(value); var ms = new MemoryStream(bytes); return(Image.FromStream(ms)); }
public static SecureString FromDatabase(string value) { if (value == null) { return(null); } var data = ByteaConverter.FromDatabase(value); var ss = new SecureString(); var decrypt = RsaProvider.Decrypt(data, false); var chars = Encoding.Unicode.GetChars(decrypt); for (int i = 0; i < chars.Length; i++) { ss.AppendChar(chars[i]); } return(ss); }