简体   繁体   中英

Winform richtextbox Append Text for 24/7

Here is my problem for the winform rich textbox, a program receive message from car parking hardware by TCP/IP and I display the Events in the winform richtextbox by

richtextbox.AppendText()

everything are working well except the program freeze within a day or two

Is there a better way to hand this?

Write to log file and bind it to the rich textbox?

This has been asked before. Things to consider: Memory limits, HD (file size) and RAM (display) If you want to implement this with WinForms and not use some existing logging code I think a ListView and a random access file of a fixed size with datetime and limited log string as a ring buffer would do. Or use eg SQLite (delete entries older than today - TimeSpan, insert new) and use a DataGridView (ideally derived and double buffered for smooth scrolling)..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM