Module Class
Performs reflection on a module.
Assembly: mscorlib (in mscorlib.dll)
A module is a portable executable file, such as type.dll or application.exe, consisting of one or more classes and interfaces. There may be multiple namespaces contained in a single module, and a namespace may span multiple modules.
One or more modules deployed as a unit compose an assembly. For information about creating an assembly with more than one module, see Multifile Assemblies.
Note that a .NET Framework module is not the same as a module in Visual Basic, which is used by a programmers to organize functions and subroutines in an application.
The following code examples show how to use reflection to get information about modules:
Imports System.Reflection Imports System Public Class Program Public Shared Sub Main() Dim c1 As New Class1 ' Show the current module. ' Note the brackets around "[Module]" to differentiate ' it from the Visual Basic "Module" keyword. Dim m As [Module] = c1.GetType().Module Console.WriteLine("The current module is {0}.", m.Name) ' List all modules in the assembly. Dim curAssembly As Assembly = Assembly.GetExecutingAssembly() Console.WriteLine("The executing assembly is {0}.", curAssembly) Dim mods() As [Module] = curAssembly.GetModules() For Each md As [Module] In mods Console.WriteLine("This assembly contains the {0} module", md.Name) Next Console.ReadLine() End Sub End Class Class Class1 End Class
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.