public partial class 排名 : Form
{
public 排名()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
List<int> top10 = new List<int>();
if (System.IO.File.Exists(System.Windows.Forms.Application.StartupPath + "\\top10.xml"))
{
top10 = (List<int>)DeserializeObject(typeof(List<int>), System.Windows.Forms.Application.StartupPath + "\\top10.xml");
}
for (int i = top10.Count; i >=0 ; i--)
{
Label la = new Label();
la.Height = 15;
la.Width = 60;
la.Text = "第" + (i + 1).ToString() + "名 " + top10[i].ToString();
la.Dock = DockStyle.Top;
panel1.Controls.Add(la);
}
}