我们需要获取类,属性,方法的描述.这个跟获取枚举的描述一样,需要我们通过反射来做.这还需要我们的利用System.ComponentModel:Description 的属性来完成. 新建一个类:使用的是: System.ComponentModel:Description [Description("类的描述")] public class TestDes { [Description("id值")] public int Id { get; set; } […
在网上查找了不少的资料,可以说大同小异,概念性的东西网上一搜一堆,今天把反射的东西整理了一下,供大家使用,我保证我这里是最全面的东西,当然也是基础的东西,在学好了这一切的基础上,大家可以学习反射的具体插件等应用,老鸟就不用看了. //首先我们建立一个类库,将它生成为HelloWorld.dll, using System;using System.Collections.Generic;using System.Text; namespace Webtest{ using System;…
错误: Could not load type 'System.Reflection.AssemblySignatureKeyAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c 调试或者在安装了VS2012的电脑上运行没事,但在干净的环境下,就报这个错误. 解决: 查了一下AssemblySignatureKeyAttribute,是.net framework4.…