mail-archives/mono-list/2003-October/016149.html

83 строки
2.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-list] Modify XML Docs
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:miguel%40ximian.com">
<META NAME="robots" CONTENT="index,nofollow">
<LINK REL="Previous" HREF="016145.html">
<LINK REL="Next" HREF="016150.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-list] Modify XML Docs
</H1>
<B>Miguel de Icaza
</B>
<A HREF="mailto:miguel%40ximian.com"
TITLE="[Mono-list] Modify XML Docs">miguel@ximian.com
</A><BR>
<I>05 Oct 2003 20:30:31 -0400</I>
<P><UL>
<LI> Previous message: <A HREF="016145.html">[Mono-list] Modify XML Docs (part 2)
</A></li>
<LI> Next message: <A HREF="016150.html">[Mono-list] Modify XML Docs
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#16149">[ date ]</a>
<a href="thread.html#16149">[ thread ]</a>
<a href="subject.html#16149">[ subject ]</a>
<a href="author.html#16149">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Hello,
&gt;<i> Well Im creating something like that, cause I'm loading the xmlfile
</I>&gt;<i> (LoadConfigFile) in a struct like this:
</I>&gt;<i>
</I>&gt;<i> private struct ConfigInfo {
</I>&gt;<i> string username;
</I>&gt;<i> string password;
</I>&gt;<i> string url;
</I>&gt;<i> string identifier;
</I>&gt;<i> }
</I>&gt;<i>
</I>&gt;<i> So if the file exists I 'load' the file in a struct
</I>&gt;<i>
</I>&gt;<i> ConfigInfo[] configtmp = new ConfigInfo[node_username.Count];
</I>&gt;<i>
</I>&gt;<i> And then start 'saving' the xml data in the struct.
</I>&gt;<i>
</I>&gt;<i> Once I have the configtmp loaded I just use it every time I need some
</I>&gt;<i> information. But what happens if the user wants to remove an account or
</I>&gt;<i> modify something (like the password), how can I save that to my xml
</I>&gt;<i> file?
</I>
That is the beauty of the XmlSerializer: You provide it with your
structured data, and it will take care of the file format used.
If you add/remove accounts in your program, you will be making changes
to the actual data structures. Then the serializer will write out and
read-in the structures for you.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI> Previous message: <A HREF="016145.html">[Mono-list] Modify XML Docs (part 2)
</A></li>
<LI> Next message: <A HREF="016150.html">[Mono-list] Modify XML Docs
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#16149">[ date ]</a>
<a href="thread.html#16149">[ thread ]</a>
<a href="subject.html#16149">[ subject ]</a>
<a href="author.html#16149">[ author ]</a>
</LI>
</UL>
</body></html>