コード例 #1
0
ファイル: Service1.cs プロジェクト: wujj1114/FileWatcher
        protected override void OnStart(string[] args)
        {
            changeMethodDelegate changeWatchmethod = new changeMethodDelegate(InvokeMethod);
            renameMethodDelegate renameWatchmethod = new renameMethodDelegate(InvokeMethod);

            w1 = new Watcher(System.Configuration.ConfigurationSettings.AppSettings["WatchForder"]//Settings1.Default.WatchForder
                , System.Configuration.ConfigurationSettings.AppSettings["FileFilter"]//Settings1.Default.FileFilter
                , changeWatchmethod
                , renameWatchmethod);
            w1.StartWatch();

            tr.Start();
        }
コード例 #2
0
ファイル: TestForm.cs プロジェクト: wujj1114/FileWatcher
        private void button1_Click(object sender, EventArgs e)
        {
            changeMethodDelegate changeWatchmethod = new changeMethodDelegate(InvokeMethod);
            renameMethodDelegate renameWatchmethod = new renameMethodDelegate(InvokeMethod);
            w1 = new Watcher(System.Configuration.ConfigurationSettings.AppSettings["WatchForder"]//Settings1.Default.WatchForder
                , System.Configuration.ConfigurationSettings.AppSettings["FileFilter"]//Settings1.Default.FileFilter
                , changeWatchmethod
                , renameWatchmethod);
            w1.StartWatch();

            WatcherTimerDelegate writelog = new WatcherTimerDelegate(log);
            tr.setOutMsg = writelog;
            tr.Start();
        }