问题描述
您好,专家,
我正在使用WPF(Windows Presentation Foundation).新手:)
问题是我想从另一个程序同时写入的日志文件中连续读取并更新表单中的文本框.因此,一个程序正在连续写入,而另一个程序正在从同一文件连续读取.
我需要一些建议来实施它的可能解决方案.
我能想到的一种解决方案是启动另一个线程,该线程以只读模式打开文件.
是否可以将文本框绑定到文本文件?因此,它会自动更新.
任何建议都会很棒!
谢谢
BR
Hi experts,
I am working with WPF (Windows Presentation Foundation). Newbie :)
The problem is I want to CONTINUOUSLY read from a log file which is being written by an other program at same time and update the textbox in the form. So, one program is continuously writing and other is continuously reading from same file.
I need suggestions what are the possible solutions to implement it.
One solution I can think of is to start another thread which opens the file in readonly mode.
Is it possible to bind text box to text file? So, that it is updated automatically.
Any suggestions will be great!
Thanks
BR
推荐答案
这篇关于C#:同时从文本文件写入/读取+ WPF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!