default.aspx.cs

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

CS
26
字号
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");

        Hashtable peopleHashtable = new Hashtable();
        peopleHashtable.Add("sh", scott);
        peopleHashtable.Add("be", bill);
        peopleHashtable.Add("ss", srini);

        Person found = (Person)peopleHashtable["sh"];
        Response.Write(found.FullName + "<BR/>");
        found = (Person)peopleHashtable["be"];
        Response.Write(found.FullName + "<BR/>");
        found = (Person)peopleHashtable["sh"];
        Response.Write(found.FullName + "<BR/>");
    }
}

⌨️ 快捷键说明

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