Source
class Program
{
static void Main(string[] args)
{
var fw = new FileSystemWatcher(@"M:\Videos\Unsorted");
fw.Created+= fw_Created;
}
static void fw_Created(object sender, FileSystemEventArgs e)
{
Console.WriteLine("added file {0}", e.Name);
}
}
Question
Should be pretty self explanatory. I'm trying to create a file watcher so I can sort my videos for me automatically...how do I get the program to not terminate, ever?
I want to keep it console-based for now so I can debug it, but eventually I want to remove the console and just have it run in the background (I guess as a service).