简体   繁体   中英

How to check and copy for newly added content in a .txt file

I need to create a file watcher which will look up a newly added file in directory for newly added data.

When ever new data is adding to a .jrn file.The newly added data should copy to a temporary file. I am using window service ( C# ) to develop this.

I solved this by following the below steps:

  1. Create a timer in order to check any new file created
  2. Use the substring method to get new added content
  3. Swap the last added two contents

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