User Tools

Site Tools

blog:2021-02-05_c_richtextbox_line_by_line_scan_and_process



2021-02-05 C#: RichTextBox Line by Line Scan and Process

  • I am creating the log file viewer and need line by line process the log in RichTextBox.
  • The solution as follows:

Solution

  •         private void Func_ConvertLogFile()
            {
                // 針對LOG的每一行過濾與轉換
                var lines = this.richTextBox_OriginalLog.Text.Split('\n').ToList();
                richTextBox_ConvertLog.Clear(); // 先清掉舊的結果
                foreach (var line in lines)
                {
                    // access a line, process it.
                    richTextBox_ConvertLog.AppendText("<>" + line + "\n");
                }
            }

TAGS

  • 228 person(s) visited this page until now.

Permalink blog/2021-02-05_c_richtextbox_line_by_line_scan_and_process.txt · Last modified: 2021/02/05 11:06 by jethro

oeffentlich