示例#1
0
        public static Stream GetStreamFromEncryptedFile(string fileName, string fileLocationLabels)
        {
            var stream = new MemoryStream();

            try
            {
                // Try opening again, and decrypting this time.
                PrcCrypto   encryptedSaver = new PrcCrypto();
                XmlDocument doc            = encryptedSaver.DisassembleEncrypted(fileName, fileLocationLabels);
                doc.Save(stream);
                stream.Position = 0;
                return(stream);
            }
            catch (Exception ex)
            {
                UiHelper.PopUpMessage(ex.Message);
                return(null);
            }
        }
示例#2
0
        public static void SaveToEncryptedFile(XDocument doc, string fileLocation)
        {
            PrcCrypto encryptedSaver = new PrcCrypto();

            encryptedSaver.AssmebleEncrypted(doc.ToXmlDocument(), fileLocation, config.labels_file_location);
        }