Where Can I find good tutorial about XMl serialization to the object? Thanks.
相关问题
- Sorting 3 numbers without branching [closed]
- Illegal to have multiple roots (start tag in epilo
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
There's a basic tutorial on Microsoft's support pages and their code example is only a few lines long:
Basically you don't have to anything other than call the built in functions that do all the hard work for you.
XML Serialization in the .NET Framework
How to serialize an object to XML by using Visual C#
Here's a good start microsoft
Also look into Xml Schema and generating classes automatically with xsd.exe the sooner you get used to this the better, it can save you a lot of effort working with XML. Also looking at the generated c# files gives you some clues on how to use attributes to manipulate the way classes are serilized by the XmlSerializer
MSDN has a decent article about it: http://msdn.microsoft.com/en-us/library/ms733901.aspx
And this one's a bit more straightforward: http://www.dotnetjohn.com/articles.aspx?articleid=173
We use Serialization to write the data in Binary Format and IN XML format. for binary format we use BibnaryFormatSerialization and for XML format we use SoapFormatSerialization.
Its really pretty simple, there are only three main steps.
[Serializable]
attribute.Serialization:
Deserialization: