private void терминалToolStripMenuItem_Click(object sender, EventArgs e) { terminalform = new TerminalForm(); terminalform.Owner = this; terminalform.Show(); terminalform.ShowBuff(this.TerminalStrings); }
public void PrintTerminal(String str) { if (this.TerminalStrings == null) { this.TerminalStrings = new List <string>(); } string newstr = "[" + System.DateTime.Now + "] " + str; using (FileStream fs = new FileStream("ModbusTest.log", FileMode.Append)) { using (StreamWriter sw = new StreamWriter(fs)) { sw.WriteLine(newstr); } } this.TerminalStrings.Add(newstr); if (terminalform.Visible) { terminalform.ShowBuff(this.TerminalStrings); } }