示例#1
0
        private void Watcher_Created(object sender, FileSystemEventArgs e)
        {
            string fileEvent = "создан";
            string filePath  = e.FullPath;

            RecordEntry(fileEvent, filePath);
            string gzfile = Extension(e.Name) + "gz";
            string tocomp = "D:\\Target\\archive\\" + gzfile;

            Archiver.Compress(e.FullPath, tocomp);
            Archiver.Decompress(tocomp, Extension(tocomp) + "txt");
        }
示例#2
0
        private void Watcher_Renamed(object sender, RenamedEventArgs e)
        {
            string fileEvent = "переименован в " + e.FullPath;
            string filePath  = e.OldFullPath;

            RecordEntry(fileEvent, filePath);
            string gzfile = Extension(e.Name) + "gz";
            string tocomp = "D:\\Target\\archive\\" + gzfile;

            Archiver.Compress(e.FullPath, tocomp);
            Archiver.Decompress(tocomp, Extension(tocomp) + "txt");
        }
示例#3
0
        private void Watcher_Created(object sender, FileSystemEventArgs e)
        {
            string fileEvent = "создан";
            string filePath  = e.FullPath;

            RecordEntry(fileEvent, filePath);
            string gzfile = Path.ChangeExtension(e.Name, "gz");
            string tocomp = Path.Combine(targetPath, "archive", gzfile);

            if (needToArchive)
            {
                Archiver.Compress(e.FullPath, tocomp, needToEncrypt);
                Archiver.Decompress(tocomp, Path.ChangeExtension(tocomp, "txt"), needToEncrypt);
            }
        }
示例#4
0
        private void Watcher_Renamed(object sender, RenamedEventArgs e)
        {
            string fileEvent = "переименован в " + e.FullPath;
            string filePath  = e.OldFullPath;

            RecordEntry(fileEvent, filePath);
            string gzfile = Path.ChangeExtension(e.Name, "gz");
            string tocomp = Path.Combine(targetPath, "archive", gzfile);

            if (needToArchive)
            {
                Archiver.Compress(e.FullPath, tocomp, needToEncrypt);
                Archiver.Decompress(tocomp, Path.ChangeExtension(tocomp, "txt"), needToEncrypt);
            }
        }