I am develop win8 metro app and I need to load xml file to present on app. But I got a problem after loading xml files located in folders.
I know I can use xmlreader to read a xml file in app itself, but I don't know how to load a file in "My Document" or any other folder out of app. So I google for it and I found I can using await XmlDocument.LoadFromFileAsync(file) to load but I don't know how to make xmlreader to read the file I loaded in xmldocument.
Or there is a way xmlreader can load xml files out of app?
I've tried to put the file path for xmlreader but it always respond "File Not Found" and the route is start from my develop directory but not from the path I set.
Can any one help me ?
below is how I deal with xmlreader, so I hope the file from xmldocument could be handled by this way:
XmlReader reader = XmlReader.Create(@"Data/question/" + file_name);
while (reader.Read())
{
// subject.Text += "start-node:\n";
switch (reader.NodeType)
{
case XmlNodeType.Element:
Element = reader.Name;
// subject.Text += String.Format("Element: {0}\n", reader.Name);
if (reader.HasAttributes)
{
// subject.Text += String.Format("Attributes of " + reader.Name + "\n");
while (reader.MoveToNextAttribute())
{
switch (Element)
{
case "SUBJECT":
switch (reader.Name)
{
case "TYPE":
type = int.Parse(reader.Value);
if (start_type == 999)
{
start_type = type;
Save_para("Start_Type", start_type);
}
last_sn += sn;
sn = 0;
break;
case "QUANTITY":
quantity = int.Parse(reader.Value);
question[type] = new string[quantity + 1][];
....