caseyl89 0 Newbie Poster

So I have this code so far to parse some values from many XML files. What I can't figure out is how to declare the folder that i need it to open.

I need the code to open up a folder on my c:\ that has lots of xml files in it that it needs to parse, can someone help me alter my code to do that. It has to parse all the files in the folder.

static void Main(string[] args)
{


     XDocument doc = XDocument.Load(C:\Sciclone UAC\" ,"*.cfg");  //this i think is wrong



var query = from x in doc.Descendants("XAxisCalib")


select new{


Max1 = x.Attribute("Max").Value,


Min2 = x.Attribute("Min").Value
};
foreach(var x in query);


Console.WriteLine("XAxisCalib");



var query2 = from x in doc.Descendants("YAxisCalib")


select new {


Max3 = x.Attribute("Max").Value,


Min4 = x.Attribute("Min").Value
};
foreach(var x in query2)


Console.WriteLine("YAxisCalib");



var query3 = from x in doc.Descendants("ZAxisCalib")


select new {


Max5 = x.Attribute("Max").Value,


Min6 = x.Attribute("Min").Value


};
foreach (var x in query3)


Console.WriteLine("ZAxisCalib");


}
}
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.