private void MnuOpen_Click(object sender, EventArgs e) { ProcessSaveFileBeforeClose(); DlgOpenText.ShowDialog(); curFileName = DlgOpenText.FileName; this.Text = $"{curFileName}* - 내메모장"; try { StreamReader sr = File.OpenText(curFileName); TxtMain.Text = sr.ReadToEnd(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void MnuOpenFile_Click(object sender, EventArgs e) { ProcessSaveBeforeClose(); DlgOpenText.ShowDialog(); currfileName = DlgOpenText.FileName; this.Text = $"{currfileName} = 내 메모장"; try { StreamReader sr = File.OpenText(currfileName); TxtMain.Text = sr.ReadToEnd(); IsModify = false; sr.Close(); } catch (Exception) { throw; } }