日期:2014-05-17 浏览次数:20477 次
public enum SomeType { TYPE1,TYPE2, TYPE3 } private void SetDropDownList() { System.Reflection.FieldInfo[] fis = typeof(SomeType).GetFields(); foreach (System.Reflection.FieldInfo fi in fis) { if (fi.FieldType == typeof(SomeType)) { DropDownList1.Items.Add(new ListItem(fi.Name)); } } }