[Mono-list] Modify XML Docs

Ben Maurer bmaurer@users.sourceforge.net
Sun, 05 Oct 2003 15:44:51 -0400


On Sun, 2003-10-05 at 14:52, Pablo Fischer wrote:
> Hello Miguel!
> 
> Well Im creating something like that, cause I'm loading the xmlfile
> (LoadConfigFile) in a struct like this:
> 
>   private struct ConfigInfo {
> 	string username;
> 	string password;
> 	string url;
> 	string identifier;
>   }
> 
> So if the file exists I 'load' the file in a struct
> 
> ConfigInfo[] configtmp = new ConfigInfo[node_username.Count];
> 
> And then start 'saving' the xml data in the struct. 
> 
> Once I have the configtmp loaded I just use it every time I need some
> information. But what happens if the user wants to remove an account
You can use an array list so you can add/remove accounts (see the msdn
docs)
>  or
> modify something (like the password)
you can modify the information
> , how can I save that to my xml
> file?
Reserialize it. Read the msdn docs.

As well, both monologue and monodoc have some examples of Xml
Serialization, you may want to check them out.