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 or
modify something (like the password), how can I save that to my xml
file?

Thanks!

El dom, 05-10-2003 a las 13:38, Miguel de Icaza escribi�:
> Hello,
> This sounds like a prime candidate for XmlSerialization, use:
> 
> public class mbloggy {
>       public Account [] accounts;
> }
> 
> public class account {
>       public string username;
>       public string password;
>       public string identifier;
>       public string url;
> }
> 
> mbloggy m = new mbloggy ();
> account a = new Account;
> m.accounts = new Account [1];
> m.accounts [0] = a;
> a.username = "Miguel";
> a.identifier = "...";
> 
> XmlSerializer s = new XmlSerializer (typeof (mbloggy));
> s.Serialize (Console.Out, m);
> 
> Miguel
-- 
Pablo Fischer Sandoval (pablo [arroba/at] pablo.com.mx)
http://www.pablo.com.mx
http://www.debianmexico.org
GPG FingerTip: 3D49 4CB8 8951 F2CA 8131 AF7C D1B9 1FB9 6B11 810C
Firma URL: http://www.pablo.com.mx/firmagpg.txt

_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to