Home   Cover Cover Cover Cover
 

Dynamic loading

Chap4_Ex17.cs
using System;
using System.Reflection;

public class TestReflection {
  public void WithoutParameters() { }
  public bool WithParameters(string p1) { return true; }
}

public class DynLoad {
  public static void Main(string[] args) {
    Assembly a = Assembly.LoadFrom("TestReflection.dll");
    Console.WriteLine("----- modules: ------");
    foreach(Module m in a.GetModules()) Console.WriteLine(m.Name);
    Console.WriteLine("----- types: ------");
    foreach(Type t in a.GetTypes()) Console.WriteLine(t.Name);
    // etc ...
  }
}