枚举

public  enum testenum

{

      aa,

      bb,

      cc,

     dd

};
//遍历枚举
foreach (testenum item in Enum.GetValues(typeof(testenum)))
{

}
Enum.GetValues(typeof(枚举的名称));可以获得指定枚举的枚举值。
Enum.GetNames(typeof(枚举的名称));可以获得指定枚举的枚举名称。

posted @ 2015-12-02 15:53  人生为卒  阅读(140)  评论(0编辑  收藏  举报