How do I save my whole program?
Posted
by
user1444829
on Stack Overflow
See other posts from Stack Overflow
or by user1444829
Published on 2012-07-02T10:34:01Z
Indexed on
2012/07/02
15:16 UTC
Read the original article
Hit count: 522
What argument should be in this missing part of formatter.Serliaze to get the program to save just the program as a .exe?
Ignore the Openfiles
.
class FileOption
{
OpenFileDialog openDialog = new OpenFileDialog();
SaveFileDialog saveDialog = new SaveFileDialog();
BinaryFormatter formatter = new BinaryFormatter();
public void Open()
{
}
public void Save()
{
if (saveDialog.ShowDialog() == DialogResult.OK)
{
FileStream file = new FileStream(saveDialog.FileName, FileMode.Create);
formatter.Serialize(file, x); // x means that i havent set anything there yet//
file.Close();
}
}
}
© Stack Overflow or respective owner