c# How can I define a dictionary that holds different types?

前端 未结 3 1478
旧时难觅i
旧时难觅i 2021-02-20 14:54

If have the following code. Where you see the XXX I would like to put in an array of type long[].

How can I do this and how would I fetch values from the dictionary? Do

3条回答
  •  离开以前
    2021-02-20 15:27

    You'd need to provide the cast where you call it.

    ((long[])defaultAmbience["countryID"])[0];
    

提交回复
热议问题