public Service1() { InitializeComponent(); lomf = ListOfManipulatedFiles.UniqueInstance; string p = FileSaverWorker.GetFolderWatcherPath(); if (!string.IsNullOrEmpty(p)) { fileSystemWatcher.Path = p; } System.IO.File.AppendAllText(FileSaverWorker.logFilePath, "[Info] Current MainFolder: " + fileSystemWatcher.Path + Environment.NewLine); }
protected override void OnStart(string[] args) { (new Thread(() => { if (args.Length > 0) { if (System.IO.Directory.Exists(args[0])) { fileSystemWatcher.Path = args[0]; FileSaverWorker.WriteFolderWatcherPath(args[0]); lomf.ResetList(); } } WCFHost.DoWork(); })).Start(); }