Csharp/CSharp Tutorial/Assembly/PortableExecutableKinds — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 15:17, 26 мая 2010
PortableExecutableKinds
<source lang="csharp">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; } } }
}</source>
main, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null: ILOnly...I386 platform independent