FileSystemWatcher监视目录不起作用. [英] FileSystemWatcher to monitor directories not working.

查看:73
本文介绍了FileSystemWatcher监视目录不起作用.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

希望有人可以帮助我找到解决我遇到的问题的方法.

我有一个应用程序,可以将文件从FTP站点下载到指定的下载位置.然后,该应用程序启动SSIS包以处理下载的目录.我想要做的是设置一个FileSystemWatcher对象来监视下载目录.当SSIS程序包处理目录时,会将其删除到存档或隔离位置.删除它们后,我希望触发FSW Changed事件并更新应用程序中的标签以显示下载文件夹中剩余的目录数. .目前,FSW Changed事件似乎并未触发,我也不知道为什么.

在此先感谢,

Grant

Hi all,

Hopefully someone can help me find a solution to a problem i'm having.

I have an application that downloads files from an FTP site to a specified download location. The application then launches an SSIS package to process the downloaded directories. What i want to do is set up a FileSystemWatcher object to monitor the download directory. As the SSIS package processes the directories it removes them to an archive or quarantine location. As they are removed i want the FSW Changed event to fire and to update a label in the application to show the number of directories remaining in the download folder.

Can someone polease nelighten me as to how this can be done. At present the FSW Changed event doesn't seem to be firing and i don't knwo why.

Thanks in advance,

Grant

推荐答案

确保已正确配置文件系统监视程序,即仔细检查是否所有事件都已附加到事件处理程序,设置了所有可能需要的过滤器,最后设置了FileSystemWatcher.EnableRaisingEvent = true?

Make sure you have properly configured the File System watcher i.e double check if all events are attached to event handlers, you have set all possible filters you need and in last you have set FileSystemWatcher.EnableRaisingEvent = true?

最好的问候


这篇关于FileSystemWatcher监视目录不起作用.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆