private void _save() { var data = new SAVEFORMAT(); data.EditorPath = textBox1.Text; util.Save(data); }
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); } }