Ejemplo n.º 1
0
        private void Button_SaveDefault_Click(object sender, EventArgs e)
        {
            StreamWriter writer = null;

            try
            {
                string path     = _MainFrame.GetLogStartPath();
                string fileName = $"{path}/{DateTime.Now.ToString("yyyy/MM/dd hh/mm/ss")}LOG.txt";
                writer = new StreamWriter(fileName);
                writer.WriteLine(Text_Logs.Text);
                MessageBox.Show($"로그파일이 저장됐습니다. 경로:\r\n[{fileName}", "성공");
                string msg = $"로그파일이 저장됐습니다. => {fileName}";
                Console.WriteLine(msg);
            }
            catch (Exception ex)
            {
                MessageBox.Show("오류가 발생했습니다.\r\n" + ex.ToString(), "실패");
                string msg = $"로그 저장에 실패했습니다.\n{ex.ToString()}";
                Console.WriteLine(msg);
            }
            finally
            {
                if (writer != null)
                {
                    writer.Close();
                }
            }
        }
 public RaidCalcOptionWindow(RaidCalcWindow MainFrame)
 {
     InitializeComponent();
     this.MainFrame      = MainFrame;
     SrcGameFile         = MainFrame.GetGameFilePath();
     Text_GameFile.Text  = SrcGameFile;
     SrcLogPath          = MainFrame.GetLogStartPath();
     Text_LogFolder.Text = SrcLogPath;
 }