I have two question, can you help me, I have a function that reads zip files beautifully but I can't read a split zip file anymore.
zip.001 zip.002
how to read zip.001 file content? and whether it is possible to read the content with special characters, e.g. ó ć ę ł, etc.
thank you in advance for your help.
regards Lobos
using (OpenFileDialog openFileDialog1 = new OpenFileDialog())
{
openFileDialog1.InitialDirectory = d.Name;
//openFileDialog1.InitialDirectory = @"c:\";
openFileDialog1.Filter = "zip files (*.zip)|*.zip |All files (*.*)|*.*";
openFileDialog1.FilterIndex = 2;
openFileDialog1.RestoreDirectory = true;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
ZipArchive zip = ZipFile.OpenRead(openFileDialog1.FileName);
listBox1.Items.Clear();
foreach (ZipArchiveEntry entry in zip.Entries)
{
string unicodeString = entry.FullName;
// Create two different encodings.
Encoding ascii = Encoding.GetEncoding("CP852");
Encoding unicode = Encoding.Unicode;
// Convert the string into a byte array.
byte[] unicodeBytes = unicode.GetBytes(unicodeString);
// Perform the conversion from one encoding to the other.
byte[] asciiBytes = Encoding.Convert(unicode, ascii, unicodeBytes);
listBox1.Items.Add(unicodeString);
listBox1.ForeColor = Color.FromArgb(1, 150, 227);
//textBox5.AppendText(entry.FullName);
// toolStripStatusLabel2.Text = " Ilość elementów: " + listBox1.Items.Count.ToString();
}
}
}