public static void SalvarResumoLivroEmXml(TOResumoLivro ObjResumo, string CaminhoASalvar) { string xml = SerializeToXml <TOResumoLivro>(ObjResumo); byte[] criptografado = HelperCriptografia.Criptografar(xml); File.WriteAllBytes(CaminhoASalvar, criptografado); }
private static void SalvarXmlCriptografado(XmlDocument XmlDocument, string PathASalvar) { using (var stringWriter = new StringWriter()) using (var xmlTextWriter = XmlWriter.Create(stringWriter)) { XmlDocument.WriteTo(xmlTextWriter); xmlTextWriter.Flush(); string xmlString = stringWriter.GetStringBuilder().ToString(); File.WriteAllBytes(PathASalvar, HelperCriptografia.Criptografar(xmlString)); } }