if somebdy makes me think
then I think
else :D
XML "database" with C#
1. Step: create class structure for dataset (I'll call it ADS)
2. Step: ADS ads = new ADS(); then init ads
3. Step: serialize
TextWriter writer = new StreamWriter("test.xml");
XmlSerializer serializer = new XmlSerializer(typeof(ADS));
serializer.Serialize(writer, ads);
writer.Close();
4. Step: delete serialize call
5. Step: start using the xml, read all your data in 5 (five) lines
XmlSerializer serializer = new XmlSerializer(typeof(ADS));
FileStream fs = new FileStream("test.xml", FileMode.Open);
XmlReader reader = new XmlTextReader(fs);
ads = (ADS)serializer.Deserialize(reader);
fs.Close();
PS. Don't forget about the try-catch(s), but throw all your oldschool ideas
Special thanks to HUPU
4 comments:
Kevered a két blogod?
nem, ide az erzelmeimet irom ... ez azt jelenti, hogy most eppen boldog vagyok. de tul is kiteszem.
PS. jo hamar lereagaltad
hurra
Egyszer elarulod, min mulik a boldogsag?
Gondolom a pillanaton.
Post a Comment