枚举类型默认修饰符为public,且不能显式使用修饰符
enum Demo
{
red = 0,
green = 1,
yellow = 2,
blue = 3
}
枚举类型转换为对应的数值
Convert.ToInt32(Demo.blue);
(int)Demo.blue;
枚举转换为字符串
数值转换为对应的字符串Demo.blue.ToString();
将字符串转换为枚举类型Enum.GetName(new Demo().GetType(), 1);
(Demo)Enum.Parse(typeof(Demo), "red");