c# 根据枚举Value 获得名称
2016-07-25 17:24
393 查看
// 定义枚举类型 enum sotype : int { book=1, pen=2, other=3 } // 输出名称 switch (Enum.GetName(typeof(sotype), 1)) { case "book": string strbook = "book"; //此时这个将被执行 break; default: break; }
相关文章推荐
- Wiggle Subsequence
- 使用EasyUI,关于日期格式的文本框按照正常方式获取不到值的问题
- textAligment、contentVerticalAlignment、contentHorizontalAlignment 和 contentMode 的对比
- 精确获取时间(QueryPerformanceCounter)
- 如何在MenuItem中添加icon图标
- 【maven 报错】maven项目执行maven install时报错Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
- poj 2299 Ultra-QuickSort (树状数组求逆序数)
- Request获取项目决定路径
- POJ 3071 Football—概率DP-conquer sea博客
- ServletActionContext.getRequest().getSession() 和 ActionContext.getContext().getSession()
- HBuilder标题栏如何穿标题呢
- 修改UITextfield的Placeholder字体的颜色
- HDU 5749 Colmerauer
- poj 2127 Greatest Common Increasing Subsequence
- 【IOS】UITableView固定headerView的方案
- Volley学习(三)ImageRequest、ImageLoader、NetworkImageView源码简读
- UI基础_自定义等高Cell_storyboard封装_版本_有GIF_源代码
- 并发编程之Operation Queue和GCD
- UI基础_自定义等高Cell_xib封装_版本_有GIF_源代码
- Distinct subsequences