Gets the module in which the type that declares the member represented by the current MemberInfo is defined.
Assembly: mscorlib (in mscorlib.dll)
The following code example declares a class that inherits Object and overrides Object.ToString. The example obtains MethodInfo objects for the class's ToString method and for the inherited GetHashCode method, and displays the names of the modules in which the two methods are declared.
Imports System Imports System.Reflection Public Class Test Public Overrides Function ToString() As String Return "An instance of class Test!" End Function End Class Public Class Example Public Shared Sub Main() Dim t As New Test() Dim mi As MethodInfo = t.GetType().GetMethod("ToString") Console.WriteLine(mi.Name & " is defined in " & mi.Module.Name) mi = t.GetType().GetMethod("GetHashCode") Console.WriteLine(mi.Name & " is defined in " & mi.Module.Name) End Sub End Class ' This example produces code similar to the following: ' 'ToString is defined in source.exe 'GetHashCode is defined in mscorlib.dll