So at the moment i am attempting to write to a password protected .dat file which is within a zip folder.
The code below attempts to do that but when i try to open that the file in the zip folder (with the correct password and all) it comes up with the following error: "windows cannot complete the extraction. The destination file cannot be created".
Any help would be appreciated.
Thank you
using (FileStream zipToOpen = new FileStream(@"System.zip", FileMode.Open)) {
// Opening zip file containing .dat files
using (ZipOutputStream OutStream = new ZipOutputStream(zipToOpen)) {
OutStream.Password = "Password";
OutStream.PutNextEntry("system.dat"); // Name of file trying to write to
MessageBox.Show(OutStream.CanWrite.ToString());//verifys that the file is writable
using (BinaryWriter b = new BinaryWriter(OutStream)) {
b.Write("hi");
}
}
}