开发者

Assembly Information

开发者 https://www.devze.com 2023-01-17 07:30 出处:网络
Hi I am working in .net project. I want to display the assembly information on the page. User will enter th开发者_Go百科e name of .net assembly in a textbox and then need to display information like

Hi I am working in .net project.

I want to display the assembly information on the page.

User will enter th开发者_Go百科e name of .net assembly in a textbox and then need to display information like all the properties, functions with parameters, constructors, destructor and inherited class names.

Please give some solution for this.


The solution is System.Reflection


using System.Reflection;

For loading assembly dynamically,use

Assembly asm=Assembly.LoadFile(@"Full path of .dll file");

Now to get all types in assembly,use

Type []alltypes=asm.GetTypes();

For information about methods, constructors,parameters,properties use

MethodInfo []GetMethods() ,ConstructorInfo []GetConstructors() ,ParameterInfo []GetParameter() ,PropertyInfo []GetProperty() etc and iterate.

And many more method are there,see the MSDN of System.Reflection

0

精彩评论

暂无评论...
验证码 换一张
取 消