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

📄 demo-hashtables.aspx

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


void Page_Load()
  {
    Hashtable myHashtable = new Hashtable();

// note: generally you only use one data type in an index.
// multiple index types shown here only for illustration


// Entry using string indices
    myHashtable["UK"] = "United Kingdom";
    myHashtable["US"] = "United States";

// Entry using numeric indices
//  myHashtable[1] = "Canada Post";
//  myHashtable[2] = "UPS";


// Entry using date indices
//  myHashtable[Convert.ToDateTime("1/1/2005")] = "Event on January 1st 2005";


    string CountryName;
    CountryName = Convert.ToString(myHashtable["UK"]);   // works fine
    // CountryName = Convert.ToString(myHashtable["uk"]);   // blank result because incorrect case
    lblOut.Text = CountryName;

  } //End Sub


</script>
<html>
    <head>
    </head>
    <body>
        <form runat="server">
        <asp:Label runat="server" ID = "lblOut">Label</asp:Label>
        </form>
    </body>
</html>

⌨️ 快捷键说明

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