Module Class performs reflection on a module. : Module « Reflection « VB.Net






Module Class performs reflection on a module.

 

Imports System.Reflection
Imports System

Public Class Program
    Public Shared Sub Main()
        Dim c1 As New Class1
        Dim m As [Module] = c1.GetType().Module
        Console.WriteLine("The current module is {0}.", m.Name)

        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
    End Sub
End Class
Class Class1

End Class

   
  








Related examples in the same category

1.Module.Assembly Property gets the appropriate Assembly for this instance of Module.
2.Module.FilterTypeName Field
3.Module.FilterTypeNameIgnoreCase
4.Module.FullyQualifiedName
5.Module.GetCustomAttributes returns all custom attributes.
6.Module.GetCustomAttributes gets custom attributes of the specified type.
7.Module.GetType returns the specified type, performing a case-sensitive search.
8.Module.GetType returns the specified type, searching the module with the specified case sensitivity.
9.Module.GetType returns type
10.Module.IsDefined tells whether the specified attribute type has been applied to this module.
11.Module.IsResource gets a value indicating whether the object is a resource.
12.Module.Name gets a String representing the name of the module with the path removed.
13.Module.ScopeName gets a string representing the name of the module.
14.Module.ToString returns the name of the module.
15.Assembly.GetModules gets all the modules that are part of this assembly.