枚举类型

来源:互联网 发布:济南舜文中淘宝节 编辑:程序博客网 时间:2024/06/05 14:52

          public enum Color
       {
        red = 1, orange , yellow, green , blue , cyan , purple
       }


       string[] strary = Enum.GetNames(typeof(Color));


        foreach (string s in strary)
        {
           string sww=s;
        }


        for (int i = 0; i < strary.Length; i++)
        {
            string iwww=Enum.Parse(typeof(Color), strary[i]).ToString();
        }
0 0
原创粉丝点击