If you are creating a Window service, then you will want to do it programmatically. I usually leave forms outside my services and create a separate interface for communication. Now FileSystemWatcher does not have an event to view only for size, so you will want to make a method related to FileSystemWatcher.Changed to check for changes to existing files. Declare and initialize the control in the OnStart method and bind events as well. Do any cleanup code in the OnStop method. It should look something like this:
protected override void OnStart(string[] args) { FileSystemWatcher Watcher = new FileSystemWatcher("PATH HERE"); Watcher.EnableRaisingEvents = true; Watcher.Changed += new FileSystemEventHandler(Watcher_Changed); }
Also note that FileSystemWatcher fires several events for a single file, so when you debug the clock for patterns to get around it.
Luke wyatt
source share