enum Color
{
    1,2,3,4,5,6,7
};
试试

解决方案 »

  1.   

    color_arr=(Color[])int_arr;改为:color_arr=Color[].Parse(int_arr.ToString());试试。
      

  2.   

    我实在不知道有什么好办法。因为Enum和Int在c#中是不同的类。
    想来想去。楼主你看这样能不能凑合用。
    using System;class App
    {
    enum Color
    {
    Red,Yellow,Blue,Green,Purple,Black,White
    };
    public static void Main()
    {
    Color []color_arr=new Color[3];// 枚举类型数组
    int []int_arr=new int[]{1,2,3};//整数类型数组
    for(int i=0;i<Math.Min(color_arr.Length,int_arr.Length);i++)
    color_arr[i]=(Color)int_arr[i];
    Console.WriteLine("The value of color[0] is:{0}",color_arr[0]);
    Console.WriteLine("The value of color[1] is:{0}",color_arr[1]);
    Console.WriteLine("The value of color[2] is:{0}",color_arr[2]);
    Console.ReadLine();
    }
    }
    最后希望能学到更好的方法,楼主能不能顺便给我点分。我现在太缺分了。555