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);
}