- Home /
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?)
Answer by Eric5h5 · Dec 27, 2011 at 06:16 PM
Webplayers do not support any kind of local file IO for security reasons.
should I use a database to store data and be able to access and count?
yes ,i changed my building platform from webplayer to pc ,the error message disappear
Your answer
![](https://koobas.hobune.stream/wayback/20220613062425im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
I dont understand why the script to read .xml doesnt works. 1 Answer
XML, Saving Data of Lists gives error 1 Answer
A node in a childnode? 1 Answer
Error while deserializing an xml file 2 Answers