首页 > 其他分享 >Dictionary<string, object>

Dictionary<string, object>

时间:2024-05-21 19:40:11浏览次数:12  
标签:Dictionary fit dcic foreach Key var

Dictionary<string, object> dcic = JsonHelper.DataRowFromJSON(resultdepth);
            foreach (var depthkey in dcic.Keys)
            {
                if (depthkey.Contains("data"))
                {
                    Dictionary<string, object> Ddata = (Dictionary<string, object>)dcic["data"];
                    foreach (var item in Ddata)
                    {
                        ArrayList Adata = (ArrayList)Ddata[item.Key];
                        foreach (var it in Adata)
                        {
                            Dictionary<string, object> Dit = (Dictionary<string, object>)it;
                            int i = 0;
                            foreach (var Kit in Dit)
                            {
                                #region 存入数据库中 如果i==0,name=visitor_depth,如果i==1,name=visitor_pv                        
                                string data = item.Key;
                                KeyValuePair<string, object> fit = (KeyValuePair<string, object>)Kit;
                                string name = fit.Key.ToString();
                                string value = fit.Value.ToString();
                                if (i == 0)
                                {
                                }
                                else if (i == 1)
                                {

                                }
                                i++;
                                #endregion
                            }
                        }
                    }
                }
            }

 

标签:Dictionary,fit,dcic,foreach,Key,var
From: https://www.cnblogs.com/qigege/p/18204791

相关文章

  • 热更学习笔记10~11----lua调用C#中的List和Dictionary、拓展类中的方法
    [10]Lua脚本调用C#中的List和Dictionary调用还是在上文中使用的C#脚本中Student类:lua脚本:print("------------访问使用C#脚本中的List和Dictionary-----------")student.list:Add(2024)student.list:Add(5)student.list:Add(18)locallistSize=student.list.Countprin......
  • c# Dictionary<TKey,TValue>.TryAdd
    原文链接:https://learn.microsoft.com/zh-cn/dotnet/fundamentals/code-analysis/quality-rules/ca1864Dictionary<TKey,TValue>.ContainsKey(TKey) 和 Dictionary<TKey,TValue>.Add 都执行查找操作,这是冗余设置。如果字典中已存在键,Dictionary<TKey,TValue>.Add 也会引发异......
  • 【python】字典(Dictionary)与集合(Set)
    字典是一种键值对的数据结构,而集合是一种无序、元素不重复的数据结构。目录前言正文一、字典(dict)    1、字典的定义    注意:        2、字典的查询    2.1语法:字典名['键名']    2.2语法:字典名.get('键名')   ......
  • WPF Add ResourceDictionary file and declared in app.xaml
    //AddresourcedictionaryfilenamedBrushes.xaml<ResourceDictionaryxmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"><LinearG......
  • C# Dictionary(字典)的键、值排序
    Dictionary<string,string>dic1=newDictionary<string,string>();dic1.Add("ddd","123");dic1.Add("aaa","123");dic1.Add("ccc","123");dic1.Add("fff",&q......
  • C# ArrayList、HashSet、HashTable、List、Dictionary的区别
    在C#中,数组由于是固定长度的,所以常常不能满足我们开发的需求。由于这种限制不方便,所以出现了ArrayList。ArrayList、List<T>ArrayList是可变长数组,你可以将任意多的数据Add到ArrayList里面。其内部维护的数组,当长度不足时,会自动扩容为原来的两倍。但是ArrayList也有一个缺点,......
  • 【Python/Numpy】list/tuple/dictionary/numpy 的操作
    CommonDataStructuresListsListsaremutablearrays.普通操作#Twowaystocreateanemptylistempty_list=[]empty_list=list()#Createalistthatcontainsdifferentdatatypes,thisisallowedinPythonmylist=["aa","bb",1,2......
  • Dictionary计算字符出现的次数
    stringstr="两只老虎,两只老虎,跑得快,跑得快。一只没有耳朵,一只没有尾巴,真奇怪,真奇怪。";Dictionary<char,int>dic=newDictionary<char,int>();for(inti=0;i<str.Length;i++){if(!dic.ContainsKey(str[i])......
  • C# 哈希表Hashtable与字典表Dictionary<K,V>的比较。
    原文链接:https://blog.csdn.net/heyuchang666/article/details/50503240?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-50503240-blog-104036330.235%5Ev43%5Epc_blog_bottom_relevance_base4&depth_1-u......
  • C# Dictionary与List的用法区别与联系
    原文链接:https://blog.csdn.net/qq_22120623/article/details/134280660C#是一门广泛应用于软件开发的编程语言,其中Dictionary和List是两种常用的集合类型。它们在存储和操作数据时有着不同的特点和用途。本文将详细探讨C#Dictionary和List的用法区别与联系,并通过代码示例进行对......