int[] array ={ 1, 3, 4, 5 };
            object[] o = (object[])System.Collections.ArrayList.Adapter((Array)array).ToArray(typeof(object));
            foreach (object oo in o)
            {
                Console.WriteLine(oo);
            }

【lovefootball】:
int[] array ={ 1, 3, 4, 5 };
            object[] o = new object[array.Length];
            Array.Copy(array, o, array.Length); 
            foreach (object oo in o)
            {
                Console.WriteLine(oo);
            }

【lovefootball】:
object[] o = Array.ConvertAll<int, object>(array, delegate(int input) { return input; });

            foreach (object oo in o)
            {
                Console.WriteLine(oo);
            }

相关文章:

  • 2022-02-10
  • 2022-02-02
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-21
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2021-08-19
相关资源
相似解决方案