How to retrieve DLL function detail

P

pizza

Hi !

I have a dll written in manage code. (csharp).
I would like to how can we programmatcially retrieve the interface for
each function written in the dll.

Something like function name, return value, each paramenter name and
variable type,
it will look something like the 'class view' , just that the parameter
name will be listed there as well.

We have the source doe of the dll, just that it is too tedious to copy
and past the function name 1 by 1.
Any idea how can i achieve that ?

Thanks in advanced.
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

pizza said:
I have a dll written in manage code. (csharp).
I would like to how can we programmatcially retrieve the interface for
each function written in the dll.

Something like function name, return value, each paramenter name and
variable type,
it will look something like the 'class view' , just that the parameter
name will be listed there as well.

We have the source doe of the dll, just that it is too tedious to copy
and past the function name 1 by 1.
Any idea how can i achieve that ?

Two code snippets that should give you the general idea.

Assembly asm = Assembly.LoadFile(fnm);
Type[] types = asm.GetExportedTypes();
foreach(Type t in types)

MethodInfo[] mets = t.GetMethods(BindingFlags.Public |
BindingFlags.Instance | BindingFlags.Static);
foreach(MethodInfo m in mets)


Arne
 
P

pizza

pizza said:
I have a dll written in manage code. (csharp).
I would like to how can we programmatcially retrieve the interface for
each function written in the dll.
Something like function name, return value, each paramenter name and
variable type,
it will look something like the 'class view' , just that the parameter
name will be listed there as well.
We have the source doe of the dll, just that it is too tedious to copy
and past the function name 1 by 1.
Any idea how can i achieve that ?Two code snippets that should give youthe general idea.

Assembly asm = Assembly.LoadFile(fnm);
Type[] types = asm.GetExportedTypes();
foreach(Type t in types)

MethodInfo[] mets = t.GetMethods(BindingFlags.Public |
BindingFlags.Instance | BindingFlags.Static);
foreach(MethodInfo m in mets)

Arne

Hi Arne !!!

Thanks for your great help !
Do you know how can i get rid of 'Property' and common method like
'GetHashCode', 'Equals', 'ToString' and 'GetType' ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top