Halcom 发表于 2024-5-13 22:14:03

C#字典重写

      MyDictionary<string, int> myDictionary = new MyDictionary<string, int>();
      public Form1()
      {
            InitializeComponent();
      }

      private void button1_Click(object sender, EventArgs e)
      {
            myDictionary.Add("apple", 1);
            myDictionary["banana"] = 2;
      }

      private void button2_Click(object sender, EventArgs e)
      {
            myDictionary.Clear();
      }

      private void button3_Click(object sender, EventArgs e)
      {
            myDictionary["banana"] = 2;
            myDictionary.Add("banana", 1);
            myDictionary.Add("banana", 10);
            int x = 0;
      }C#源代码下载链接:链接:https://pan.baidu.com/s/1Jah-yd6PyUHpJ5lKfp3t-A提取码:2cbu
百度贴吧链接:C#字典重写【halcom中国吧】_百度贴吧 (baidu.com)

页: [1]
查看完整版本: C#字典重写