Error A local variable cannot be declared in this

2019-06-14 15:57发布

I am trying to unzip a file with DotNetZip but I get a error on the "e"

using (ZipFile zip = ZipFile.Read(openFileDialog1.FileName))
{
    foreach (ZipEntry e in zip)
    {
        e.Extract(Environment.CurrentDirectory, ExtractExistingFileAction.OverwriteSilently);
    }
}

标签: c# dotnetzip
1条回答
聊天终结者
2楼-- · 2019-06-14 16:29

I suspect you are doing this inside an event handler which already has a parameter called e.

Try renaming e to entry inside the foreach.

查看更多
登录 后发表回答