Click here to Skip to main content
15,896,153 members

Comments by sz3bbylA (Top 3 by date)

sz3bbylA 5-Feb-19 13:18pm View    
so, i don't know to do this , any example, link is helpfull
sz3bbylA 4-Feb-19 18:13pm View    
I already done something like :
xmldoc.xml
Hide Copy Code
<root>
<one>first_one
<two>second_one
<tree>third_one <four>fourth_one
<five>fifth_one
<six>sixth_one



Hide Copy Code
class Use_Xml
{
public static void Save_data(object obj, string filename)
{
XmlSerializer sd = new XmlSerializer(obj.GetType());
TextWriter writer = new StreamWriter(filename);
sd.Serialize(writer, obj);
writer.Close();
}
}


Hide Copy Code
public class Setting
{
private string one_val;
private string two_val;
private string tree_val;
private string four_val;
private string five_val;
private string six_val;

public string One
{
get { return one_val; }
set { one_val = value; }
}
.......................................
public string Six
{
get { return six_val; }
set { six_val = value; }
}
}


I call it with:

Hide Copy Code
Setting set = new Setting
{
One = "one_second",
...................
Six = "six_second"
}
Use_Xml.Save_data(set, location_file);


This One only can update all values

My problem is
1. I want to update one, two or all values
2. I want to read one, two ... or all values

I try to use deserializer but i was stack

i see some solutions but not fit with my situation
i would like to do a setting file to save parameters of program to be loaded on Window_Loaded
the problem i want just to update parameters also to read one, or more parameters
sz3bbylA 4-Feb-19 13:21pm View    
Data at the root level is invalid. Line 1, position 1.
I not expert, srry, i don't know to use it