如何选择下一个枚举值?

时间:2016-04-21 21:30:37

标签: c# enums

我是C#枚举类型:

private enum DayName { Monday=1, Tuesday=2 ... Sunday=7 };

private DayName today ;

today = DayName.Friday;

如何做以下事情:

today ++ ;
print(today) -> 

得到"星期六" ?

1 个答案:

答案 0 :(得分:0)

首先设置today = DayName.Friday,然后设置print(today.ToString()

之后的today ++ ;

正如此帖所述,Enum String Name from Value