Dieser Artikel wurde noch nicht bewertet - Dieses Thema bewerten.

Module.Assembly-Eigenschaft

Ruft die entsprechende Assembly für diese Instanz von Module ab.

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

public Assembly Assembly { get; }
/** @property */
public Assembly get_Assembly ()

public function get Assembly () : Assembly

Eigenschaftenwert

Ein Assembly-Objekt.

Im folgenden Beispiel wird der vollständige Name der angegebenen Assembly im angegebenen Modul angezeigt.

using System;
using System.Reflection;

namespace ReflectionModule_Examples
{
    class MyMainClass
    {
        static void Main()
        {
            Module[] moduleArray;
            
            moduleArray = Assembly.GetExecutingAssembly().GetModules(false);
            
            // In a simple project with only one module, the module at index
            // 0 will be the module containing this class.
            Module myModule = moduleArray[0];

            Assembly myAssembly = myModule.Assembly;
            Console.WriteLine("myModule.Assembly = {0}.", myAssembly.FullName);
        }
    }
}

package ReflectionModule_Examples ;
import System.*;
import System.Reflection.*;

class MyMainClass
{
    public static void main(String[] args)
    {
        Module moduleArray[];
        moduleArray = Assembly.GetExecutingAssembly().GetModules(false);

        // In a simple project with only one module, the module at index
        // 0 will be the module containing this class.
        Module myModule = (Module)moduleArray.get_Item(0);
        Assembly myAssembly = myModule.get_Assembly();
        Console.WriteLine("myModule.Assembly = {0}.", 
            myAssembly.get_FullName());
    } //main
} //MyMainClass   

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

.NET Compact Framework

Unterstützt in: 2.0, 1.0
Fanden Sie dies hilfreich?
(1500 verbleibende Zeichen)
© 2013 Microsoft. Alle Rechte vorbehalten.