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

推荐订阅源

博客园_首页
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
G
Google Developers Blog
B
Blog
Engineering at Meta
Engineering at Meta
阮一峰的网络日志
阮一峰的网络日志
The Register - Security
The Register - Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 叶小钗
The Cloudflare Blog
The Hacker News
The Hacker News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
雷峰网
雷峰网
F
Fortinet All Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
T
Threat Research - Cisco Blogs
A
About on SuperTechFans
量子位
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
H
Help Net Security
Help Net Security
Help Net Security
P
Palo Alto Networks Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Troy Hunt's Blog
W
WeLiveSecurity
V
Vulnerabilities – Threatpost
T
The Exploit Database - CXSecurity.com
Know Your Adversary
Know Your Adversary
Apple Machine Learning Research
Apple Machine Learning Research
Scott Helme
Scott Helme
N
News | PayPal Newsroom
AWS News Blog
AWS News Blog
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
MongoDB | Blog
MongoDB | Blog
B
Blog RSS Feed
腾讯CDC
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
TaoSecurity Blog
TaoSecurity Blog
GbyAI
GbyAI
Y
Y Combinator Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
D
Docker

博客园 - 铭天

亲家网络的面试,请大家谨慎过去 redis命令String 安装redis RedHat6安装gcc Visual Studio 2015激活码,Visual Studio 2015密钥 从程序员到翻译的感受 取客户MAP地址 .net中的浅拷贝和深拷贝 DataReader转实体<T> Jquery传数组数据到Mvc后台 Silverlight TreeView控件的增删改查 Visual Studio 2010序列号 SilverLight3访问Wcf - 铭天 - 博客园 DataTable到范型转换 访问Oracle11g的.net组件 js特效和树 自定义WebPart菜单 JSChart控件 & Ajax 图片 SilverLight2CheckBox动态调用WebService
关于.Net类型转换
铭天 · 2012-10-30 · via 博客园 - 铭天

        public static T ChangeType<T>(object value)
        {
            Type conversionType = typeof(T);
            if (value is DBNull)
            {
                return default(T);
            }
            if (conversionType.IsGenericType && conversionType.GetGenericTypeDefinition().Equals(typeof(Nullable<>)))
            {
                if (value == null) { return default(T); }
                conversionType = Nullable.GetUnderlyingType(conversionType); ;
            }
            return (T)Convert.ChangeType(value, conversionType);
        }

posted on 2012-10-30 09:36  铭天  阅读(230)  评论()    收藏  举报