get dictionary value by key

前端 未结 10 1950
逝去的感伤
逝去的感伤 2020-11-29 20:47

How can I get the dictionary value by key on function

my function code is this ( and the command what I try but didn\'t work ):

static void XML_Array         


        
10条回答
  •  无人及你
    2020-11-29 21:10

    Why not just use key name on dictionary, C# has this:

     Dictionary dict = new Dictionary();
     dict.Add("UserID", "test");
     string userIDFromDictionaryByKey = dict["UserID"];
    

    If you look at the tip suggestion:

提交回复
热议问题