Filesystem watcher and large files

后端 未结 5 457
感情败类
感情败类 2020-12-02 21:42
var fsw = new FileSystemWatcher(sPath, \"*.PPF\");
fsw.NotifyFilter = NotifyFilters.FileName;
fsw.IncludeSubdirectories = true;
fsw.Created += FswCreated;
fsw.Enable         


        
5条回答
  •  庸人自扰
    2020-12-02 22:09

    I support the solution accepted by Shay Erlichmen. But however a) You may wan't to open the File with access mode FileAccess.Read, incase its a read only file

    b) Some programs whilst downloading, the file will have some funny extension and when completed, the extension will change, and although file would have completed you will have file not found exception.

    So handle the exceptions, and also subscribe to file.renamed event

提交回复
热议问题