Module Class Performs reflection on a module. : Module « Reflection « C# / C Sharp






Module Class Performs reflection on a module.

 

using System.Reflection;
using System;
public class Program {

    public static void Main() {
        Class1 c1 = new Class1();
        Module m = c1.GetType().Module;
        Console.WriteLine("The current module is {0}.", m.Name);

        Assembly curAssembly = Assembly.GetExecutingAssembly();
        Console.WriteLine("The current executing assembly is {0}.", curAssembly);

        Module[] mods = curAssembly.GetModules();
        foreach (Module md in mods) {
            Console.WriteLine("This assembly contains the {0} module", md.Name);
        }
    }
}
class Class1 {
}

   
  








Related examples in the same category

1.Load Assembly
2.Module.Assembly
3.Module.FilterTypeName
4.Module.Filter Type Name
5.Module.Fully Qualified Name
6.Module.Is Defined
7.Module.Is Resource
8.Module.ToString