Examining a Currently Running Process for Type Information : Type « Data Types « C# / C Sharp






Examining a Currently Running Process for Type Information

Examining a Currently Running Process for Type Information
using System;
using System.Reflection;
using System.Diagnostics;
   
class AssemType {
  public static void Main(string[] args) {
       Process p = Process.GetCurrentProcess();
       string assemblyName = p.ProcessName + ".exe";
       Console.WriteLine("Examining : {0}", assemblyName);
       Assembly a = Assembly.LoadFrom(assemblyName);
   
       Type[] types = a.GetTypes();
       foreach(Type t in types)
       {
            Console.WriteLine("\nType : {0}",t.FullName);
            Console.WriteLine("\tBase class: {0}",t.BaseType.FullName);
       }
  }
}

           
       








Related examples in the same category

1.Check the MinValue and MaxValue
2.Querying Type Information by NameQuerying Type Information by Name
3.Querying Type Information Using the Instance of an ObjectQuerying Type Information Using the Instance of an Object