0

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);
    }
}
svick
  • 236,525
  • 50
  • 385
  • 514
Orangelight
  • 147
  • 2
  • 3
  • 8
  • 1
    What is the exact text of the error? – SLaks Apr 28 '13 at 12:57
  • which error did you get? – zzfima Apr 28 '13 at 12:58
  • 1
    You're lacking context. Please give the full method. There probably will be another local variable or parameter with the name `e`. The `EventArgs` parameter on eventhandlers is often called `e`. – CodesInChaos Apr 28 '13 at 12:58
  • 1
    C# does not allow the same "simple name" to be used twice in the same block to mean two different things. Somewhere in this method you use "e" to mean something else. Change one of them. – Eric Lippert Apr 28 '13 at 14:36

1 Answers1

18

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.

Matthew Watson
  • 104,400
  • 10
  • 158
  • 276