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

📄 program.cs

📁 C#2.0宝典源码,C#经典书籍,很多例子
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;

namespace Example9_46 {
    class Program {
        static void Main(string[] args) {
            Dictionary<string, string> myDic = new Dictionary<string, string>(5);

            myDic.Add("Hi", "你好");
            myDic.Add("Book", "书");
            myDic.Add("Microsoft", "微软");
            myDic.Add("Code", "代码");
            myDic.Add("Read", "读");
            myDic.Add("Look", "看");

            bool myBool1 = myDic.ContainsKey("Hi");
            bool myBool2 = myDic.ContainsKey("Hello");

            bool myBool3 = myDic.ContainsValue("书");
            bool myBool4 = myDic.ContainsValue("课本");

            Console.WriteLine("是否包含“Hi”: {0}", myBool1);
            Console.WriteLine("是否包含“Hello”: {0}", myBool2);
            Console.WriteLine("是否包含“书”: {0}", myBool3);
            Console.WriteLine("是否包含“课本”: {0}", myBool4);

            Console.ReadLine();
        }
    }
}

⌨️ 快捷键说明

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