After some research, I found DotNetZip very easy to use when it comes to reading files in zip files. Sadly, I did run into a minor issue.
My zip file is set up like this:
Using the following code, I keep stumbling upon it not finding an entry
using (ZipFile zip = ZipFile.Read(modPath))
{
string[] temp1 = modPath.Split('\\');
string mod = temp1[temp1.Length - 1];
mod = mod.Remove(mod.Length - 6);
string modinfo = @mod + "/info.json";
ZipEntry e = zip[modinfo]; // No entry found here
}
Am I overlooking something here?
Edit: Added the loop to get the name
You can iterate through the contents of the zip file using foreach and then find your file.
using (ZipFile zip = ZipFile.Read(modPath))
{
ZipEntry e;
foreach (ZipEntry k in zip)
{
if (k.FileName.Contains("info.json"))
{
e = k;
break;
}
}
}