Assume that there is an entity class. Using system.xml; using system.xml.serialization;
Namespace TestPerson {Public Class Person {Public String Fullname
Public String Password; Public Male Sex;}
Public Enum Male {m, f}} first decided to use XML serialization to put the status DUMP of the object to an XML file. The code is as follows: Person P = New Person (); p.FullName = "MontaQuehou"; p.password = "test"; p.sex = Male.m;
XMLSERIALIZER DEMOSERIALIZER = New XMLSerializer (TypeOf (Person));
FILESTREAM FS = New FileStream ("C: //test.xml", filemode.create, fileaccess.readwrite; Demoserializer.Serialize (fs, p); fs.close (); Note Reference System.Runtime.Serialization.Formatters. The DLL problem is: 1. Does the Person class do not add a serilizable property? Can you serialize successful? 2. Can PASSWORD be dUMP to file?