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
精彩评论