查表
using System;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// A simple indexer example.
/// </summary>
class ConsolePrint
{
static void Main(string[] args)
{
Dictionary<string, string> dctNewWay =
new Dictionary<string, string>()
{
{"Key1", "AAAA"}, {"Key2", "BBBB"},
{"Key3", "CCCC"}, {"Key4", "DDDD"}
};
dctNewWay.Add("Key5", "EEEE");
String FindByKey = dctNewWay["Key1"];
bool AnyKey = dctNewWay.ContainsKey("key1");
Console.WriteLine("FindByKey = {0}", FindByKey);
Console.ReadLine();
}
}
Good!```````
回覆刪除