Exemplo n.º 1
0
        public static string WriteFile(string filePath, string data, bool encrypt = false,
                                       string passPhrase = "dummy_phase")
        {
            if (string.IsNullOrEmpty(filePath))
            {
                return(null);
            }

            if (encrypt == true)
            {
                data = DesCipher.Encrypt(data, passPhrase);
            }

            using (StreamWriter sw = new StreamWriter(filePath))
            {
                sw.WriteLine(data);
            }

            return(filePath);
        }