摘要: [System.Xml.Serialization.XmlType(Namespace="http://tempuri.org/zeetest",TypeName="Cls1")] public class Class1 { public Class1() { this._c1 = new System.Collections.ArrayList(); this._c1.Add("asdas"); this._c1.Add("dfvdgdg"); } private string _s1; [System.Xml.Serialization.XmlElement("s1")] public string s1 { get {return _s1;} set {_s1 = value;} }
private string _s2; [System.Xml.Serialization.XmlElement("s2")] public string s2 { get {return _s2;} }
public void setS2(string value) { this._s2 = value; }
private System.Collections.ArrayList _c1; [System.Xml.Serialization.XmlElement("c1")] public System.Collections.ArrayList c1 { get {return _c1;} }
[System.Xml.Serialization.XmlAttribute("s3")] public string s3;
[System.Xml.Serialization.XmlAttribute("s4")] public readonly string s4 = "aaaa"; }
当创建一个Class1的实例并用XmlSerializer序列化的时候。
Class1的属性s1/s2/c1以及字段s3/s4,你认为哪些会出现在Serialize之后的Xml文本中呢?...[
阅读全文]