build error: error CS1061: Type System.IO.DirectoryInfo 'does not Contain a definition ...'

I create xml containing data. To be sure the name of the xml does not exist, I look at the number of files in the folder and I add this to the end:

private ArrayList tabNameOfXML;
public string ReadDirectory () {
string path = @ Application.dataPath + "/ Media /";
DirectoryInfo info = new DirectoryInfo (path);
FileInfo [] = info.GetFiles FileInfo ();
int cpt = -1;
foreach (FileInfo file in FileInfo)
{
cpt + +;
}
string refname = "soft" cpt;//+". + xml ";
return refname;
}

Read “standalone” everything works but if I try to do a “build” for the web, I go out an error like this:

Assets / Standard Assets / Scripts / Utility Scripts / XML / WriteInXML.cs (128.40): error CS1061: Type System.IO.DirectoryInfo 'does not Contain a definition for GetFiles’ and no extension method GetFiles' type of System.IO.DirectoryInfo 'Could Be found (are you missing a using directive or assembly reference year?)

Webplayers do not support any kind of local file IO for security reasons.