private void EVESaveIn(object sender, EventArgs e) { string rez = _currentpath; if (DialogResult.OK == SFD1.ShowDialog()) { rez = SFD1.FileName; File.Delete(SFD1.FileName); RTBMyText.SaveFile(SFD1.FileName); } else { MessageBox.Show("Cancel"); } _currentpath = rez; }
private void saveToFileToolStripMenuItem_Click(object sender, EventArgs e) { DialogResult res = SFD1.ShowDialog(); if (res.ToString() != "") { StreamWriter SWriter = new StreamWriter(SFD1.FileName); for (int i = 0; i < weights.GetUpperBound(0); i++) { for (int j = 0; j < weights.GetUpperBound(0); j++) { SWriter.Write(weights[i + 1, j + 1].ToString() + "\t"); } SWriter.Write("\r\n"); } SWriter.Close(); } }
private void EVESave(object sender, EventArgs e) { string rez = _currentpath; if (_currentpath == "C:\\MyFirstProject.rtf") { if (DialogResult.OK == SFD1.ShowDialog()) { rez = SFD1.FileName + ".rtf"; RTBMyText.SaveFile(rez); MessageBox.Show(rez); } else { MessageBox.Show("Cancel"); } _currentpath = rez; } else { RTBMyText.SaveFile(_currentpath); } }