public void Write(string Text) { FileStream logStream = File.Open(Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName, @"Logs\\text.txt"), FileMode.Append); StreamWriter streamWriter = new StreamWriter(logStream); for (int i = 0; i < Txt; i++) { streamWriter.WriteLine(Text); } streamWriter.Close(); for (int i = 0; i < DataGrid; i++) { SingletonLog.GetInstance().WriteDataGrid(Text); } for (int i = 0; i < RichTextBox; i++) { SingletonLog.GetInstance().WriteTextBox(Text); } }
private void button3_Click(object sender, EventArgs e) { SingletonLog.GetInstance().log.Show(); }
private void Log_FormClosed(object sender, FormClosedEventArgs e) { SingletonLog.GetInstance().log = new Log(); }