Is it possible to enumerate every function present in a DLL ? How about getting its signature ?
Can I do this in C# ? Or do I have to go low level to do this?
Regards and tks,
Jose
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If it’s a .NET DLL RedGate’s Reflector can list the methods and even attempt to disassemble the code. It’s a great item for any developer’s toolbox and it’s free
Edit: If you are trying to read the types and methods at runtime you’ll want to use Reflection. You would have to load the
AssemblyandGetExportedTypes. Then, iterate over theMembersto the theMethodsandProperties. Here is an article from MSDN that has an example of iterating over theMemberInfoinformation. Also, here is an MSDN Magazine article, Extracting Data from .NET Assemblies.Finally, Here is a little test method I wrote for executing a method on a loaded object.
In this example ClassLibrary1 has one class of Class1:
And here is the test: