using System;
using System.Reflection;
//using string_module;
//csc get_assembly_constructor_type.cs
namespace ex_indexer_1
{
public class get_type
{
public void process(string str)
{
Assembly asm = Assembly.LoadFrom(str);
Type[] all_type = asm.GetTypes();
foreach(Type e in all_type)
{
Console.WriteLine("Found : {0} ", e);
}
Type t_cl = all_type[0];
Type t_cl_1 = all_type[1];
Console.WriteLine("\t Class Name {0} ",t_cl.Name);
Console.WriteLine("\t Class Name {0} ",t_cl_1.Name);
//
ConstructorInfo[] all_ct = t_cl.GetConstructors();
foreach(ConstructorInfo c in all_ct)
{ Console.WriteLine("\t Constructor {0} ",t_cl.Name);}
}
}//end of get_type
class test
{
static void Main()
{
String str = "";
Console.WriteLine("You may use either of two or any exe");
Console.WriteLine(@"C:\MySharp\reflection\ex1\reflection_typeof_operator.exe");
Console.WriteLine(@"C:\MySharp\reflection\ex1\get_assembly_constructor_type.exe");
Console.WriteLine(@"C:\MySharp\reflection\ex1\instance_constructor.exe");
Console.Write("Enter Here : " );
str =Console.ReadLine();
if (str !="")
{ get_type gt = new get_type();
gt.process(str);
}
else return;
Console.ReadLine();
}
}
}//end of namespace