C# 遍历枚举

代码

        
/// <summary>
        
/// 遍历枚举绑定
        
/// </summary>
        public void BindTreeType()
        {
            
//遍历枚举绑定
            foreach (string str in Enum.GetNames(typeof(ENUM.E_treeType)))
            {
                ddlTreeType.Items.Add(str, Enum.Parse(
typeof(ENUM.E_treeType), str).GetHashCode());
            }
        }

 

posted @ 2010-12-18 11:33  jgjg2323  阅读(225)  评论(0编辑  收藏  举报