Using a FileSystemWatcher with Windows Service

前端 未结 1 1589
情歌与酒
情歌与酒 2020-12-30 12:16

I have a windows service which needs to monitor a directory for files and then move it to another directory. I am using a FileSystemWatcher to implement this.

This i

相关标签:
1条回答
  • 2020-12-30 13:14

    Your local variable fp get disposed off once it goes out of scope. The solution is to declare it as an instance variable instead

    0 讨论(0)
提交回复
热议问题