public class Global : System.Web.HttpApplication { private FileSystemWatcher fsw; protected void Application_Start(object sender, EventArgs e) { string monitorPath = this.Context.Server.MapPath("~/dir1/dir2/" + DateTime.Now.Year.ToString()); Application.Add("watcher", new FileSystemWatcher(monitorPath)); fsw = (FileSystemWatcher)Application["watcher"]; fsw.EnableRaisingEvents = true; fsw.IncludeSubdirectories = false; fsw.Changed += new FileSystemEventHandler(fsw_Changed); } private void fsw_Changed(object sender, FileSystemEventArgs e) { //....... //....... } }
fsw.NotifyFilter = NotifyFilters.LastAccess;
fsw.Changed += new FileSystemEventHandler(fsw_Changed);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)