hi All, I want to zip all files. I receive error message; System.IO.IOException HResult=0x80070050 Message=The file 'C:\Users\family\Desktop\Ver\NM 1.zip' already exists. Source=mscorlib StackTrace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at System.IO.Compression.ZipFile.Open(String archiveFileName, ZipArchiveMode mode, Encoding entryNameEncoding) at System.IO.Compression.ZipFile.DoCreateFromDirectory(String sourceDirectoryName, String destinationArchiveFileName, Nullable`1 compressionLevel, Boolean includeBaseDirectory, Encoding entryNameEncoding) at System.IO.Compression.ZipFile.CreateFromDirectory(String sourceDirectoryName, String destinationArchiveFileName, CompressionLevel compressionLevel, Boolean includeBaseDirectory) at CZip_2.Form1.OnRenamed(Object sender, RenamedEventArgs e) in C:\Users\family\source\repos\CZip_2\CZip_2\Form1.cs:line 95 at System.IO.FileSystemWatcher.OnRenamed(RenamedEventArgs e) at System.IO.FileSystemWatcher.NotifyRenameEventArgs(WatcherChangeTypes action, String name, String oldName) at System.IO.FileSystemWatcher.CompletionStatusChanged(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) This exception was originally thrown at this call stack: [External Code] CZip_2.Form1.OnRenamed(object, System.IO.RenamedEventArgs) in Form1.cs [External Code] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO; using System.IO.Compression; using System.Threading; namespace CZip_2 { public partial class Form1 : Form { private string TargetPath = @"d:\test11\"; private bool IsNewFile = false; private string newFilePath; FileSystemWatcher watcher = new FileSystemWatcher(); List filesAdded = new List(); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { watcher.NotifyFilter = NotifyFilters.Attributes | NotifyFilters.CreationTime | NotifyFilters.DirectoryName | NotifyFilters.FileName | NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.Security | NotifyFilters.Size; string sOri = @"C:\"; watcher.Path = sOri; watcher.Created += OnCreated; watcher.Renamed += OnRenamed; watcher.IncludeSubdirectories = true; watcher.EnableRaisingEvents = true; } void OnCreated(object source, FileSystemEventArgs e) { System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false; newFilePath = e.FullPath; IsNewFile = true; filesAdded.Add(e.FullPath + e.Name); foreach (var sfile in filesAdded) { listBox1.Items.Add(sfile); } } private void OnRenamed(object sender, RenamedEventArgs e) { if (IsNewFile && e.OldFullPath == newFilePath) { FileInfo fileInfo = new FileInfo(e.FullPath); string TargetFile = Path.Combine(TargetPath, fileInfo.Name); using (StreamWriter fileV = new System.IO.StreamWriter(fileInfo.Name)) { foreach (var sfile in fileInfo.Name) { fileV.WriteLine(sfile); } } if (File.Exists(TargetFile)) { File.Delete(TargetFile); } Thread.Sleep(2000); File.Move(fileInfo.Name, TargetFile); string fi1 = @"D:\test11\"; string fi2 = @"C:\Users\family\Desktop\Ver\NM 1.zip"; ZipFile.CreateFromDirectory(fi1, fi2, CompressionLevel.Fastest, true); } } } }