Module.FullName : Module « System.Reflection « C# / C Sharp by API






Module.FullName

  

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;

public class MainClass
{
    public static void Main()
    {
        Assembly a = Assembly.GetExecutingAssembly();
        Module m = a.ManifestModule;

        PortableExecutableKinds peKinds;
        ImageFileMachine imageFileMachine;
        m.GetPEKind(out peKinds, out imageFileMachine);

        Console.WriteLine("{0}: {1}...{2}", a.FullName, peKinds, imageFileMachine);

        if ((peKinds & PortableExecutableKinds.ILOnly) != 0)
        {
            Console.WriteLine("platform independent");
        }
        else
        {
            Console.WriteLine("platform dependent");
            switch (imageFileMachine)
            {
                case ImageFileMachine.I386:
                    Console.WriteLine("I386");
                    break;
                case ImageFileMachine.IA64:
                    Console.WriteLine("IA64");
                    break;
                case ImageFileMachine.AMD64:
                    Console.WriteLine("AMD64");
                    break;
            }
        } 
    }
}

   
    
  








Related examples in the same category