Exemplo n.º 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");
        }
Exemplo n.º 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");
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
            }
        }