Get current Process Name

image_pdfimage_print
   
  

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("
Type : {0}",t.FullName);
      Console.WriteLine("	Base class : {0}",t.BaseType.FullName);
    }
  }
}