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"); }
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"); }
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); } }
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); } }