I've put Xml file into the "Application Data Folder". Im able to read it without any problem.
Code for read the file:
Code: Select all
public string path = @"C:\Users\NewPC\AppData\Local\Packages\45307261-1dc6-4817-b962-2a59d79ec272_h909besz0ssn6\LocalState\Contabilita.xml";
// Load Xml File
XDocument doc = XDocument.Load(path);
IEnumerable<XElement> childList =
from el in doc.Descendants("Contabilita")
select el;
foreach (XElement en in childList)
{
foreach (XElement test in en.Elements())
{
System.Diagnostics.Debug.Write(test.Name + ": ");
System.Diagnostics.Debug.WriteLine(test.Value);
if (test.Name == "Antimanomission")
{
// Write 8 to the Element Antimanomission
test.Value = "8";
System.Diagnostics.Debug.WriteLine("passed from here");
}
}
}
Code: Select all
doc.Save(path);
cannot convert from 'string' to 'System.IO.Stream'
So far as i can understand need a stream ... but also passing a stream my file is not modified ... is there someone that have a working example ?
sorry but are 3 days that im working on that ...
Thanks you very much