using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication2
{
public partial class Form1 : Form
{
private List<login> l;
private DataSet ds;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
l = new List<login>();
l.Add(new login("hehe", "123"));
l.Add(new login("hoho", "abc"));
System.IO.TextWriter tr = new System.IO.StreamWriter(@"c:\abc.xml");
System.Xml.Serialization.XmlSerializer sr = new System.Xml.Serialization.XmlSerializer(l.GetType());
sr.Serialize(tr, l);
tr.Close();
ds = new DataSet();
}
public string Name
{
get { return _name; }
set { _name = value; }
}
public string Pwd
{
get { return _pwd; }
set { _pwd = value; }
}
}
}
----------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication2
{
public partial class Form1 : Form
{
private List<login> l;
public Form1()
{
InitializeComponent();
}