private void SerialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e) { string line = port.ReadLine(); this.BeginInvoke(new LineReceivedEvent(LineReceived), line); RichLogBox.AppendText(line + "\r\n"); RichLogBox.ScrollToCaret(); }
void OutToRichLog(string type, string output) { if (type == "HTTP") { // string myfiles = Rich RichLogBox.ForeColor = System.Drawing.Color.LightGreen; RichLogBox.AppendText("@ " + output + "\r\n"); RichLogBox.ScrollToCaret(); } else if (type == "Com") { RichLogBox.ForeColor = System.Drawing.Color.SkyBlue; RichLogBox.AppendText("● " + output + "\r\n"); RichLogBox.ScrollToCaret(); } else { RichLogBox.AppendText(output + "\r\n"); RichLogBox.ScrollToCaret(); } }