c# - Saving to xml file -
i have question updating data in current xml file.
for example want change radius "50"
xml file:
<?xml version="1.0" encoding="utf-8"?> <settings> <radius>25</radius> <length>40</length> <height>15</height> <name>oks</name> </settings>
i can read these settings code:
public void getsettings() { xmldocument xml = new xmldocument(); xml.load(location); xmlnodelist xnlist = xml.selectnodes("/settings"); foreach (xmlnode xn in xnlist) { tb_height.text = xn["height"].innertext; tb_lenght.text = xn["length"].innertext; tb_radius.text = xn["radius"].innertext; tb_name.text = xn["name"].innertext; } }
not sure trying do.
but save file, can simply:
xml.save(pathtosaveto);
Comments
Post a Comment