字典 Key值转换为数组

public static string[] GetCategories()
    {
        Dictionary<string, int> itemMap = new Dictionary<string, int>(); 
        int count = itemMap.Count;
        string[] keys = new string[count];
        itemMap.Keys.CopyTo( keys, 0 );
        return keys;
    }

 

posted @ 2015-04-17 10:45  大表哥的笔记  阅读(2899)  评论(0编辑  收藏  举报