|
-
Jan 28th, 2003, 12:01 PM
#1
Thread Starter
Lively Member
How to retrieve the methods from a dll?
How to retrieve the methods from a dll?
Can I retrieve them using the System.Reflection.Assembly? How?
Thanks!
-
Jan 28th, 2003, 09:07 PM
#2
Code:
System.Reflection.Assembly assembly = System.Reflection.Assembly.LoadFrom("myassembly.dll");
Type[] types = assembly.GetExportedTypes();
foreach(Type type in types)
{
string typename;
if(type.IsClass)
typename = "class";
else if(type.IsValueType)
typename = "struct";
else if(type.IsEnum)
typename = "enum";
else
continue;
Console.WriteLine("Assembly defines a "+typename+" named "+type.FullName);
}
You could extend this thing using various methods of Type.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 28th, 2003, 09:08 PM
#3
Or do you mean functions from a normal dll? Look up PInvoke in the reference.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|