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

推荐订阅源

Project Zero
Project Zero
Security Archives - TechRepublic
Security Archives - TechRepublic
C
Cyber Attacks, Cyber Crime and Cyber Security
Security Latest
Security Latest
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
V
Vulnerabilities – Threatpost
C
CERT Recently Published Vulnerability Notes
S
Schneier on Security
G
GRAHAM CLULEY
L
Lohrmann on Cybersecurity
D
Darknet – Hacking Tools, Hacker News & Cyber Security
I
Intezer
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
F
Full Disclosure
T
The Exploit Database - CXSecurity.com
P
Proofpoint News Feed
WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
H
Help Net Security
大猫的无限游戏
大猫的无限游戏
MyScale Blog
MyScale Blog
Hacker News: Ask HN
Hacker News: Ask HN
G
Google Developers Blog
H
Heimdal Security Blog
O
OpenAI News
Hugging Face - Blog
Hugging Face - Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
LangChain Blog
C
Cisco Blogs
云风的 BLOG
云风的 BLOG
IT之家
IT之家
Cyberwarzone
Cyberwarzone
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Know Your Adversary
Know Your Adversary
博客园 - 聂微东
The Cloudflare Blog
C
Check Point Blog
K
Kaspersky official blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
月光博客
月光博客
T
Tor Project blog
T
Threat Research - Cisco Blogs
T
Tailwind CSS Blog
P
Proofpoint News Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
A
About on SuperTechFans
小众软件
小众软件
Cloudbric
Cloudbric
A
Arctic Wolf

博客园 - Waver

Tabbing problems in Firefox in Mac OS X [转] Data Flow Diagrams Tutorial [转] HTML Ampersand Character Codes 也谈完美跨域,JavaScript [转] 浏览器类型检测. (JavaScript) 【转】 Route命令使用详解[转] 使用塑料水瓶要当心 Design Material Websites Summarization. - Waver How to cut through the complexity to find a solution. How to install flash player on Google Chrome browser? ADODB.Stream 对象的属性与方法 VB/VBScript读取和保存UTF-8文件方案 VB6: How To Convert UTF-8 Byte Arrays into Unicode Strings (and vice versa) Perl和OLE Automation Perl Unicode全攻略 ASP+COM 组件开发 SQL高级语法 无法去掉“关闭高级语言服务”解决方案! GCT 英语单词全部核心词汇A-Z GCT 工硕英语词汇语法
Extension Method for ENUM.
Waver · 2009-08-25 · via 博客园 - Waver

        public static string GetStringValue(this Enum value)
        {
            Type type = value.GetType();
            FieldInfo fieldInfo = type.GetField(value.ToString());

            StringValueAttribute[] attribs = fieldInfo.GetCustomAttributes(typeof(StringValueAttribute), false) as StringValueAttribute[];

            return attribs.Length > 0 ? attribs[0].StringValue : null;
        }

      class StringValueAttribute : Attribute
    {
        private string stringvalue = string.Empty;

        public string StringValue
        {
            get { return stringvalue; }
            set { stringvalue = value; }
        }

        public StringValueAttribute(string value)
        {
            stringvalue = value;
        }
    }