.net有没有类型下面的东西!
Dictionary<string, string,string,int,c1...> myDic = new Dictionary<string, string,string,int,c1...>();mydic.Add("aaa","bbb","ccc",5 new c1());如果没有的话要怎么构造啊!我用DataTable 循环添加 DataColumn
在循环添加DataRow感觉太复杂了!

解决方案 »

  1.   

    怎么构造啊!
    Dictionary <string, string,string,int,c1...> 是不定的
      

  2.   


    using System;  
    class Test
    {
        static void F(params object[] a)
        {
            Console.WriteLine("F(object[])");
        }
        static void F()
        {
            Console.WriteLine("F()");
        }
        static void F(object a0, object a1)
        {
            Console.WriteLine("F(object,object)");
        }
        static void Main()
        {
            F();
            F(1);
            F(1, 2);
            F(1, 2, 3);
            F(1, 2, 3, 4);
        }
    }  
      产生输出  
       
      F();  
      F(object[]);  
      F(object,object);  
      F(object[]);  
      F(object[]); 
      

  3.   

    用集合命名空间下的Dictionary , 他的键和值的类型用Object作为数据部分,然后Object又可以自己定义数据了。
    不知道说清了没有!
      

  4.   

    Dictionary<A,B>class A
    {
    public int X
    public int Y
    }class B
    {
    public int X
    public int Y
    }
      

  5.   

    public class TestEntity
    {
        public string string1{get;set;}
        public string string2{get;set;}
        public int int1{get;set;}
    }使用:
    TestEntity test = new TestEntity();
    test.string1="abc";
    test.string2="def";
    test.int1=0;
    Dictionary <TestEntity> myDic = new Dictionary <TestEntity>();
    myDic.Add(test);
      

  6.   

    上面说错了,Dictionary 是hashtable的进化。
      

  7.   

    Dictionary <string, string,string,int,c1...> 是不定的 再说 TestEntity 中的字段 是根据条件计算 出来的