Exemplo n.º 1
0
        private void _save()
        {
            var data = new SAVEFORMAT();

            data.EditorPath = textBox1.Text;

            util.Save(data);
        }
Exemplo n.º 2
0
Arquivo: util.cs Projeto: iruka-/slag
        public static void Save(SAVEFORMAT data)
        {
            var ms = new MemoryStream();
            var bf = new BinaryFormatter();

            bf.Serialize(ms, data);

            if (!Directory.Exists(Path.GetDirectoryName(m_savepth)))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(m_savepth));
            }
            try {
                File.WriteAllBytes(m_savepth, ms.ToArray());
            }
            catch (SystemException e)
            {
                MessageBox.Show(e.Message);
            }
        }