This documentation is archived and is not being maintained.

Module.ScopeName Property

Gets a string representing the name of the module.

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

public string ScopeName { get; }
/** @property */
public String get_ScopeName ()

public function get ScopeName () : String

Property Value

The module name.

The ScopeName property is not used by the common language runtime, but you can use it to store any string you want in the property when you emit a module using the metadata APIs. Reflection itself does not allow you to set the ScopeName property.

This example shows the effect of the ScopeName, FullyQualifiedName, and Name properties.

using System.Reflection;
using System;

public class Simple
{
   public static void Main ()
   {
        Module mod = Assembly.GetExecutingAssembly().GetModules () [0];
        Console.WriteLine ("Module Name is "
           + mod.Name);
        Console.WriteLine ("Module FullyQualifiedName is "
           + mod.FullyQualifiedName);
        Console.WriteLine ("Module ScopeName is "
           + mod.ScopeName);
   }
}
/*
Produces this output:
Module Name is modname.exe
Module FullyQualifiedName is C:\Bin\modname.exe
Module ScopeName is modname.exe
*/

import System.Reflection.*;
import System.*;

public class Simple
{   
    public static void main(String[] args)
    {
        Module mod = Assembly.GetExecutingAssembly().GetModules()[0];
        Console.WriteLine(("Module Name is " + mod.get_Name()));
        Console.WriteLine(("Module FullyQualifiedName is " 
            + mod.get_FullyQualifiedName()));
        Console.WriteLine(("Module ScopeName is " + mod.get_ScopeName()));
    } //main
} //Simple

/*
 Produces this output:
 Module Name is modname.exe
 Module FullyQualifiedName is C:\Bin\modname.exe
 Module ScopeName is modname.exe
 */

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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0
Show: