المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : getting a list of all classes from a referenced dll.



C# Programming
04-11-2009, 12:11 PM
I created a console application called "InputDLL" and added reference to
it in my second application called "Tester"

InputDLL application has one class called "Class1".

Here instead of hardcoding the name of the class, is there any way
I can get the name of the class programatically?

Following is my code:
---------------------

using InputDLL;

namespace Tester
{
class Program
{
static void Main(string[] args)
{
Type type = typeof(InputDLL.Class1);

foreach (MethodInfo methodInfo in type.GetMethods())
{
Console.WriteLine("{0}", methodInfo.Name);
}
}
}
}

Thanks,
NetQuestions