⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tio-hashtable.aspx

📁 asp.net1.1入门经典C#.2003
💻 ASPX
字号:
<%@ Page Language="C#" Debug="true" %>
<script runat="server">

    void Page_Load()
    {
    lblShow.Visible = false;
    if (Page.IsPostBack)
    {
      DateTime datDateIn;
      Hashtable hashConcerts = new Hashtable();
      hashConcerts[Convert.ToDateTime("1/3/2005")] = "Bridgemen";
      hashConcerts[Convert.ToDateTime("1/4/2005")] = "Vanguard";
      hashConcerts[Convert.ToDateTime("1/2/2005")] = "Blue Devils";
      hashConcerts[Convert.ToDateTime("1/1/2005")] = "Belevederes";
    
      datDateIn = Convert.ToDateTime(txtDateIn.Text);
      lblShow.Text = "On this date enjoy the: ";
      lblShow.Text += hashConcerts[datDateIn];
      lblShow.Visible = true;
    }   //End if (Page.IsPostBack)
    }   //End  Page_Load

</script>
<html>
<head>
    <title>HashTable Example</title>
</head>
<body>
    <form runat="server">
        <h3>2005 Drum and Bugle Corps Concert 
        </h3>
        Please enter a date between 1/1/2005 and 1/4/2005 
        <asp:TextBox id="txtDateIn" runat="server"></asp:TextBox>
        <br />
        <asp:Button id="Button1" runat="server" Text="Look up"></asp:Button>
        <br />
        <asp:Label id="lblShow" runat="server"></asp:Label>
    </form>
</body>
</html>

⌨️ 快捷键说明

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