我得到的是这样的东西,我要怎么转换

解决方案 »

  1.   

    foreach(object p in list){                string var=p.name;}
      

  2.   

    两位数字中的元素是object,你想转换成什么
      

  3.   


     object[] arr = new object[3];
                arr[0] = 1;
                arr[1] = "test";
                Button testButton = new Button();
                testButton.ID = "testButton";
                arr[2] = testButton;            string stringResult = string.Empty;
                int intResult = 0;
                Button btnResult = null;            foreach (object item in arr)
                {
                    if (item is string)
                    {
                        stringResult = (string)item;
                    }
                    else if (item is int)
                    {
                        intResult = (int)item;
                    }
                    else if (item is Button)
                    {
                        btnResult = (Button)item;
                    }            }
    强制转换一下就是了,你想知道什么
      

  4.   

    不同的对象有不同的解决方法。要看你的range是什么了