EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

Assembly.GetModules Method

May 11, 2014

Gets all the modules that are part of this assembly.

Namespace:  System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

'Déclaration
Public Function GetModules As Module()

Return Value

Type: System.Reflection.Module ()
An array of modules.

ExceptionCondition
FileNotFoundException

The module to be loaded does not specify a file name extension.

This method works on public and private resource files.

NoteNote:

Modules must be emitted with file name extensions.

The following example displays the name of the module in the returned array that contains the assembly manifest.


Imports System.Reflection

Public Class Example

   Public Shared Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock)
      Dim mainAssembly As [Assembly] = [Assembly].GetExecutingAssembly()
      outputBlock.Text += String.Format("The executing assembly is {0}.", mainAssembly) & vbCrLf
      Dim mods() As [Module] = mainAssembly.GetModules()
      outputBlock.Text &= vbTab & "Modules in the assembly:" & vbCrLf
      For Each m As [Module] In mods
         outputBlock.Text &= vbTab & m.ToString() & vbCrLf
      Next
   End Sub 'Main
End Class 'Form1


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Afficher:
© 2014 Microsoft