G
Gary Brown
Hi,
If there is an exception during writing a file with StreamWriter how
do you abort the creation of the new file? Due to introducing a bug
an existing file was lost (backed-up, fortunately) when the "Write"
hit the bug. The incomplete file closed and overwrote its
predecessor. How do I prevent this from happening again? The
catches didn't.
The abbreviate code is:
using (StreamWriter SW = new StreamWriter(Filepath))
{
try
{
Write(SW);
}
catch (Exception e)
{
MessageBox.Show(e.Message, "...");
throw;
}
}
catch (Exception e) { MessageBox.Show(e.Message, "..."); }
Thanks,
Gary
If there is an exception during writing a file with StreamWriter how
do you abort the creation of the new file? Due to introducing a bug
an existing file was lost (backed-up, fortunately) when the "Write"
hit the bug. The incomplete file closed and overwrote its
predecessor. How do I prevent this from happening again? The
catches didn't.
The abbreviate code is:
using (StreamWriter SW = new StreamWriter(Filepath))
{
try
{
Write(SW);
}
catch (Exception e)
{
MessageBox.Show(e.Message, "...");
throw;
}
}
catch (Exception e) { MessageBox.Show(e.Message, "..."); }
Thanks,
Gary