-2

Could someone please help me create a simple windows C# app that would look in a specified folder? The app basically will on the click of a button watch a specified folder and if a new file is put into the folder it opens the file and does some processing with it. I also need to consider if multiple files are created into the folder at relatively the same time.

I can create the project and the screen with Visual Studio, I just really need some help with creating the code to loop, watch and process files in the folder. I've tried using FileSystemWatcher but the problem is it will not process multiple files (or at least files that were put into the folder at the relative same time). Also it will not process a second file if it's added to the folder while the first file is being processed.

Any help or guidance on this would be really REALLY helpful. Please feel free to explain in great detail. :D

Andy
  • 383
  • 1
  • 6
  • 23
  • we aren't a code writing service. – Daniel A. White Jan 16 '18 at 20:09
  • @DanielA.White, I'm asking for help. As I said, guidance to help me create something that I don't know how to do myself. From a person who's new to C# and coding in Visual Studio it's extremely helpful that there are people here that can do this in their sleep. If I had that knowledge, I would be glad to help someone that is struggling and doesn't understand. I would think that's one of the main reasons why this website exists. Learn, Share, Build? – Andy Jan 16 '18 at 20:35

1 Answers1

0

According to this question: FileSystemWatcher vs polling to watch for file changes it is mostly a problem of the InternalBufferSize try to push that value a little up. But there are also some situations, where even that won't work e.g. network shares.

The alternative would be polling as said in the other question, which means that you need a list of the current files in the folder and a timer, that cyclic compares the items inside the folder with which are in the stored list.

geraphl
  • 305
  • 4
  • 10