/// <summary>
/// 一个对象序列化
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Button1_Click(object sender, EventArgs e)
{
User user = new User() { ID=1001,Name="小王",Add="北京",Age=21};
var str = SHelper.SaveXmlFromObj<User>(user);
this.TextBox1.Text = str;
}
/// <summary>
/// 多个对象序列化
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Button2_Click(object sender, EventArgs e)
{
Users users = new Users();
User user = new User() { ID = 1001, Name = "小王", Add = "北京", Age = 21 };
users.Datas.Add(user);
users.Datas.Add(user);
users.Datas.Add(user);
var str = SHelper.SaveXmlFromObj<Users>(users);
this.TextBox2.Text = str;
}