Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi guys,

I am trying to generate statistics on C# winforms and the data is stored into a txt file.

How can i know when a new data has entered into this txt file? (To update the statistics)

it is practicle to do so ? maybe there are other ways which are easier?

What I have tried:

I cannot find anything on google maybe it is not practicle to do so ?
Posted
Updated 6-Aug-18 21:17pm
Comments
Richard MacCutchan 7-Aug-18 3:06am    
You cannot tell when a file has been updated unless you have a FileSystem watcher that can send a message to your application.
Joe Doe234 7-Aug-18 3:10am    
how can i do that ? is there a type of tutorial or something .. sorry i'm still a student.
Pete O'Hanlon 7-Aug-18 3:28am    
Search Google for FileSystemWatcher.

1 solution

See the documentation: FileSystemWatcher Class (System.IO)[^] - it includes example code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900