C# 序列化类问题

来源:百度知道 编辑:UC知道 时间:2024/06/17 07:34:09
<abc>
<Field>100</Field>
<item>
<a>a</a>
<b>b</b>
<c>c</c>
</item>
<item>
<a>a</a>
<b>b</b>
<c>c</c>
</item>
<item......
</abc>

通过接口序列化类,像DNT论坛程序那样的做发,想上面那样的需要这么做。有谁知道?
前题是像DNT那样的,通过接口序列化和反序列化。结构清晰的
2楼好像不对吧!
<item>.....</item>这里是不知道数量的...
分数跑不了

实体类代码
namespace XulieHua
{
[Serializable]
public class Information
{
private string id;

public string Id
{
get { return id; }
set { id = value; }
}
private string name;

public string Name
{
get { return name; }
set { name = value; }
}
private string sex;

public string Sex
{
get { return sex; }
set { sex = value; }
}
public Information()
{

}

public Information(string id,string name,string sex)
{
this.Id = id;
this.Name = name;
this.Sex = sex;
}
}
}

事件触发代码
////引入命名空间
using System.Xml;
us