private void importToolStripMenuItem_Click(object sender, EventArgs e) { try { if (saveFile.ShowDialog() == DialogResult.OK) { string pathOfsaveFile = saveFile.FileName; administration.Save(pathOfsaveFile); } } catch (ArgumentNullException arnull) { MessageBox.Show(arnull.Message); } catch (PathTooLongException pathlong) { MessageBox.Show(pathlong.Message); } catch (ArgumentException argument) { MessageBox.Show(argument.Message); } catch (IOException io) { MessageBox.Show(io.Message); } }
private void btnSave_Click(object sender, EventArgs e) { if (saveFileDialog1.ShowDialog() == DialogResult.OK) { string savePath = saveFileDialog1.FileName; admin.Save(savePath); } }
private void btnSave_Click(object sender, EventArgs e) { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "Database for animal shelter |*.thisisadatabaseforanimalshelter"; if (sfd.ShowDialog() == DialogResult.OK) { administration.Save(sfd.FileName); } }
private void btnSave_Click(object sender, EventArgs e) { try { Administration.Save(fileName); } catch (ArgumentNullException ex) { MessageBox.Show(ex.Message); } catch (ArgumentException ex) { MessageBox.Show(ex.Message); } catch (PathTooLongException ex) { MessageBox.Show(ex.Message); } catch (FileNotFoundException ex) { MessageBox.Show(ex.Message); } }