Exemple #1
0
        private void OnChanged(object source, FileSystemEventArgs e)
        {
            string dir = @"C:\GiamSat\" + e.Name;

            if (e.FullPath == dir)
            {
                Console.WriteLine("File: " + e.FullPath + " " + e.ChangeType);
                SoGhiGiamSatThuMuc.WriteEntry("Da co thao tac Changed trong thu muc C:\\GiamSat");
            }
        }
Exemple #2
0
        public void OnRenamed(object source, FileSystemEventArgs e)
        {
            string dir = @"C:\GiamSat\" + e.Name;

            if (e.FullPath == dir)
            {
                Console.WriteLine("File: {0} rename to {1}", dir, e.FullPath);
                SoGhiGiamSatThuMuc.WriteEntry("Da co thao tac Renamed trong thu muc C:\\GiamSat");
            }
        }
Exemple #3
0
        protected override void OnStart(string[] args)
        {
            try
            {
                SoGhiGiamSatThuMuc.WriteEntry("Running");
                Thread _t = new Thread(new ThreadStart(DoWork));
                _t.IsBackground = true;
                _t.Start();
            }
            catch (Exception ex)
            {
                SoGhiGiamSatThuMuc.WriteEntry(ex.Message);
                SoGhiGiamSatThuMuc.Close();
            }

            Console.ReadLine();
        }
Exemple #4
0
 protected override void OnStop()
 {
     SoGhiGiamSatThuMuc.WriteEntry("Stopped");
 }