惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
Jina AI
Jina AI
H
Help Net Security
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
MyScale Blog
MyScale Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
L
LangChain Blog
Recorded Future
Recorded Future
F
Full Disclosure
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
GbyAI
GbyAI
B
Blog RSS Feed
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
M
MIT News - Artificial intelligence
爱范儿
爱范儿
V
V2EX
Microsoft Azure Blog
Microsoft Azure Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Y
Y Combinator Blog
B
Blog
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
W
WeLiveSecurity
MongoDB | Blog
MongoDB | Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
The Cloudflare Blog
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
D
DataBreaches.Net
博客园 - 【当耐特】
T
Troy Hunt's Blog
V
Visual Studio Blog
V2EX - 技术
V2EX - 技术
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 司徒正美
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google Online Security Blog
Google Online Security Blog
The GitHub Blog
The GitHub Blog

博客园 - StephenJu

EntLib--Unity Application Block 1.x DevExpress杂项 .Net异步机制 简单的异步调用 按s1_Name+uuid为一组拆分DS 分割dataset:待改进... 序列化 DataGridViewComboBoxColumn的使用 datagridview数据验证 通过关键字查找到dgv相关记录后定位 禁止一个程序启动多个实例 将文本文件的内容写进某个表中 获取Assembly的运行路径 获取ArrayList中的数据(foreach) 关于DataTable里大批量查找的更快速的方法 抽象类 IO DynamicCreateMenu DataTable的简单方法
枚举
StephenJu · 2008-12-26 · via 博客园 - StephenJu

public enum EnumName //tt:枚举名
        {
            [Description(
"t1描述")]//枚举标记t1的描述
            t1=1,//t1:枚举标记 1:枚举值
            [Description("t2描述")]
            t2
=2,
            [Description(
"t3描述")]
            t3
=3
        }
private string GetEnumDescription(Enum enumValue)
        {

            FieldInfo fieldInfo 

= enumValue.GetType().GetField(enumValue.ToString().Trim());
            DescriptionAttribute[] attritutes 
= fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), falseas DescriptionAttribute[];
            
return attritutes.Length > 0 ? attritutes[0].Description: enumValue.ToString();
        }
//根据枚举标记获得枚举值
            int iEnumValue = (int)Enum.Parse(typeof(EnumName), Convert.ToString(EnumName.t1));
//result:1
            
//根据枚举值得到枚举标记
            EnumName t_type = (EnumName)Enum.Parse(typeof(EnumName), Convert.ToString(iEnumValue), false);
//result:t1
            
//根据枚举标记获得其描述
            string strDescription = GetEnumDescription(t_type);
//result:t1描述