C#用for循环来遍历枚举中的每个值

作者:管理员 更新时间:2014-03-03 14:14

string[] names = Enum.GetNames(typeof(IMSv2Extend.CreateHtmlURLEnum));

foreach (string item in names)

{

   %><option value="<%=item %>"><%=item %></option><%

}

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

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

来源:亦有软件
软件产品Eysln Software Product
亦有公告Eysln Notice
案例中心Eysln Template
知识库Eysln Knowledge Base
工具箱Eysln Toolkit Online