Sharepoint SiteUserInfoList 获取所有键和值

Sharepoint SiteUserInfoList get all keys and values

我需要从 Sharepoint 2013 SiteUserInfoList 列表中获取所有键值对。

我目前有以下代码:

            SPWeb web = new SPSite("http://sp2013:2013/_catalogs/users/detail.aspx").OpenWeb();
            SPList item = web.SiteUserInfoList;

            foreach (SPListItem f in item.Items)
            {
                foreach (var it in f.Fields)
                {
                    // Here I would like to print out key value pairs
                    Console.WriteLine("Tile: {0}:{1}", it, it.ToString());
                }
            }
            Console.ReadLine();

使用以下内容:

Console.WriteLine("Tile: {0}:{1}", it.Title, f[it.Title]);

SPFields是键值集合。要访问它的值,需要传递相应的key。