Assembly.GetModules Method ()
.NET Framework 3.0
Gets all the modules that are part of this assembly.
Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly: mscorlib (in mscorlib.dll)
The following example displays the name of the module in the returned array that contains the assembly manifest.
using namespace System; using namespace System::Reflection; int main() { Assembly^ mainAssembly = Assembly::GetExecutingAssembly(); Console::WriteLine( "The executing assembly is {0}.", mainAssembly ); array<Module^>^mods = mainAssembly->GetModules(); Console::WriteLine( "\tModules in the assembly:" ); for ( int i = 0; i < mods->Length; i++ ) Console::WriteLine( "\t{0}", mods[ i ] ); }
import System.*;
import System.Reflection.*;
public class Form1
{
public static void main(String[] args)
{
Assembly mainAssembly = Assembly.GetExecutingAssembly();
Module mainMod = mainAssembly.GetModules()[0];
Console.WriteLine("The executing assembly is {0}.", mainAssembly);
} //main
} //Form1
var mainAssembly : Assembly = Assembly.GetExecutingAssembly(); var mainMod : Module = mainAssembly.GetModules()[0]; Console.WriteLine("Module name: {0}", mainMod.Name);
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show:
Note: