Breyta

Deila með


Module.FullyQualifiedName Property

Definition

Gets a string representing the fully qualified name and path to this module.

public:
 virtual property System::String ^ FullyQualifiedName { System::String ^ get(); };
public virtual string FullyQualifiedName { get; }
member this.FullyQualifiedName : string
Public Overridable ReadOnly Property FullyQualifiedName As String

Property Value

The fully qualified module name.

Exceptions

The caller does not have the required permissions.

Examples

The following example displays the fully qualified name of the specified module.

using namespace System;
using namespace System::Reflection;
int main()
{
   array<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 ];
   Console::WriteLine( "myModule.FullyQualifiedName = {0}", myModule->FullyQualifiedName );
}
using System;
using System.Reflection;

namespace ReflectionModule_Examples
{
    class MyMainClass
    {
        static void Main()
        {
            Module[] moduleArray;
            
            moduleArray = typeof(MyMainClass).Assembly.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];

            Console.WriteLine("myModule.FullyQualifiedName = {0}", myModule.FullyQualifiedName);
        }
    }
}
Imports System.Reflection

Namespace ReflectionModule_Examples
    Class MyMainClass
        Shared Sub Main()
            Dim moduleArray() As [Module]

            moduleArray = GetType(MyMainClass).Assembly.GetModules(False)

            ' In a simple project with only one module, the module at index
            ' 0 will be the module containing this class.
            Dim myModule As [Module] = moduleArray(0)

            Console.WriteLine("myModule.FullyQualifiedName = {0}", myModule.FullyQualifiedName)
        End Sub
    End Class
End Namespace 'ReflectionModule_Examples

Remarks

To get the name without the path, use Name.

If the assembly for this module was loaded from a byte array then the FullyQualifiedName for the module will be: <Unknown>.

Note

The case of module name is platform-dependent.

Applies to