开发者

Assembly Information

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜