for (int i = 0; i < listBox1.Items.Count; i++) { var fil2 = File.ReadAllBytes(@listBox1.Items[i].ToString()); using (FileStream fs = new FileStream("done.exe", FileMode.Append, FileAccess.Write)) { fs.Write(fil2, 0, fil2.Length); } } If the cycle goes to 2, then everything is fine, but if the cycle goes up to 3, as it gives an error that it cannot access done.exe because it is busy with another process, can you help solve the problem?
forloop needs to be moved insideusing (FileStream...). - Bulson