default.aspx.cs

来自「對c#初學者參考..為課題asp.net 2.0教材代碼」· CS 代码 · 共 30 行

CS
30
字号
using System;
using System.Collections;
using System.Collections.Generic; 

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Person scott = new Person("Scott", "Hanselman");
        Person bill = new Person("Bill", "Evjen");
        Person srini = new Person("Srinivasa", "Sivakumar");

        List<Person> people = new List<Person>(); 
        people.Add(scott);
        people.Add(bill);
        people.Add(srini);

        foreach (Person p in people)
        {
            Response.Write(p.FullName + "<BR/>");
        }

        for (int i = 0; i < people.Count; i++)
        {
            Response.Write(people[i].FullName + "<BR/>");
        }

    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?