tags:

views:

66

answers:

5
+1  Q: 

New file in folder

Hello

I want to detect when a new file is added to a existing folder and access it.

How can I do this (C#)?

Thanks

+3  A: 

You should take a look at System.IO.FileSystemWatcher, this is the class you might want to use.

Atmocreations
+6  A: 

See FileSystemWatcher

  1. Tutorial 1
  2. Tutorial 2
mykhaylo
Don't forget that this method is not a 100% reliable in all circumstances (read the remarks section in MSDN). For a fail-safe implementation there is no way around (additional) polling.
0xA3
Thanks, great tutorials!
RuiT
+1  A: 

Using the FileSystemWatcher class

Christian Vik
A: 

I am not a Windows dude, but generally speaking, find out if there is a Windows API call which allows you to watch a directory.

Amit
+1  A: 

Use the FileSystemWatcher class wich raises events when a file is created, updated etc.

FileSystemWatcher

magnus