the following statement has an error, help to fix it.

```
 long siz = dirinfo.EnumerateFiles().Sum(file => file.length);

```

> 
> 'System.IO.DirectoryInfo' does not contain a definition for
>  'EnumerateFiles' and no extension method 'EnumerateFiles' accepting a
>  first argument of type 'System.IO.DirectoryInfo' could be found (are
>  you missing a using directive or an assembly reference?)
> 
> 
> 

Is there is any name space required? I already put the namespace `System.IO`.

As all of you said i changed the code and 

static long dirsize(DirectoryInfo dirinfo,bool includesubdir)
 {
 siz += dirinfo.GetFiles("\*", SearchOption.AllDirectories).Sum(dire => dirsize(dire, true));

}

when i am using it it gives an error as 
cannot convert from fileinfo to directoryinfo .

my question is will i get the one particular directory size by changing the directoryinfo to fileinfo ...? is it possible...? Please help me out to fix it. Thanks in Advance.