In simple way, I want to save some data in XML file when i tried this code it ran successfully but,unfortunately i didn’t the file in the project folder or anywhere on my computer.When I changed the path also i didn’t find it.
The following is the used code
string configFile = @"config.xml";
XmlDocument xml = new XmlDocument();
XmlElement element = xml.CreateElement("Configuration");
xml.AppendChild(element);
//---create the <LastAccess> element---
element = xml.CreateElement("LastAccess");
element.InnerText = DateTime.Now.ToString();
xml.DocumentElement.AppendChild(element);
//---create the <LastSearchString> element---
element = xml.CreateElement("LastSearchString");
element.InnerText = "sushi";
xml.DocumentElement.AppendChild(element);
xml.Save(configFile);
Can you help me in this problem please.
When I wrote this code and ran the application the file must be saved whatever where
XmlDocument xml = new XmlDocument();
XmlElement element = xml.CreateElement("First");
xml.AppendChild(element);
element = xml.CreateElement("Second");
element.InnerText = "LaLa";
xml.DocumentElement.AppendChild(element);
xml.Save(@"XML.xml");
and then i try this code as the file has been saved
element.InnerText = "LaLa";
xml.DocumentElement.AppendChild(element);
xml.Save(@"XML.xml");
I got that exception Could not find file ‘\XML.xml’.
please can you help me in this problem.
The emulator is, for all intents and purposes of this question, a completely separate device. It does not “share” any part of it’s file system with the host PC, so there’s no way to “browse” it’s files (like the one you created” from the PC’s Windows Explorer, or the standard file system APIs.
If you want access to the file from the PC, you need to use one of the following to retrieve it: