Module.ToString 方法  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回模块的名称。
public:
 override System::String ^ ToString();public override string ToString ();override this.ToString : unit -> stringPublic Overrides Function ToString () As String返回
表示此模块的名称的 String。
示例
以下示例演示如何使用 ToString 方法。
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->ToString returns: {0}", myModule );
}
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.ToString returns: {0}", myModule.ToString());
        }
    }
}
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.ToString returns: {0}", myModule.ToString())
        End Sub
    End Class
End Namespace 'ReflectionModule_Examples