зеркало из https://github.com/mono/mail-archives.git
83 строки
2.8 KiB
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,
|
|
|
|
><i> Well Im creating something like that, cause I'm loading the xmlfile
|
|
</I>><i> (LoadConfigFile) in a struct like this:
|
|
</I>><i>
|
|
</I>><i> private struct ConfigInfo {
|
|
</I>><i> string username;
|
|
</I>><i> string password;
|
|
</I>><i> string url;
|
|
</I>><i> string identifier;
|
|
</I>><i> }
|
|
</I>><i>
|
|
</I>><i> So if the file exists I 'load' the file in a struct
|
|
</I>><i>
|
|
</I>><i> ConfigInfo[] configtmp = new ConfigInfo[node_username.Count];
|
|
</I>><i>
|
|
</I>><i> And then start 'saving' the xml data in the struct.
|
|
</I>><i>
|
|
</I>><i> Once I have the configtmp loaded I just use it every time I need some
|
|
</I>><i> information. But what happens if the user wants to remove an account or
|
|
</I>><i> modify something (like the password), how can I save that to my xml
|
|
</I>><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>
|