public static void FreshStart(string pass, string path) { var KeyFile = Path.Combine(Environment .GetFolderPath(Environment.SpecialFolder.ApplicationData) .ToString(), "MetaFile.SafeBox"); FileStream fs = new FileStream(KeyFile, FileMode.OpenOrCreate); fs.Close(); string bas = pass + "#" + path + "$"; var text = StringCipher.GenerateName(bas); File.WriteAllText(KeyFile, text); Debug.WriteLine("All Done , Restart Application"); }
private void Write(string pass, string respo, int change = 0) { FileStream fs = new FileStream(KeyFile(), FileMode.OpenOrCreate); fs.Close(); if (change == 1) { password = pass; RespoPath = respo; } respo = Path.Combine(respo, "SafeBox"); string bas = pass + "#" + respo + "$"; try { File.WriteAllText(KeyFile(), StringCipher.GenerateName(bas)); Debug.WriteLine("### MetaFile Written Successfully ##"); } catch (Exception q) { Debug.WriteLine(q.Message + "###error in writing in mf"); } }