问题描述
我有一个用于通过GUI显示传感器值的Windows窗体应用程序。我的GUI输入是一个文本文件,由传感器询问器不断更新。我读取文本文件,将其保存到列表中并对其进行计算和操作。
目前我的应用程序仅适用于静态txt文件,我希望它能够直接从不断更新的txt文件。
可以这样做吗?
我已经尝试过使用FilsSstemWatcher类,但没什么用。
我试过从代码项目文章中获取想法 [ ^ ]
I have a windows form application for displaying sensor values through a GUI. The input for my GUI is a text file that is being continuously updated by a Sensor interrogator. I read the text file, save it onto a list and do my calculations and manipulations on it.
At present my application works only for a static txt file, I want it to be capable of directly reading from the continuously updated txt file.
Can this be done?
I already tried using the FilsSstemWatcher class but to no much use.
I tried taking ideas from a codeproject article Use FileSystemWatcher in a Practical Scenario[^]
推荐答案
这篇关于动态文件读取C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!