用System.Reflection里面的东西啊。

解决方案 »

  1.   

    // LoadInvoke loads MyAssembly.dll and invokes the MyMethod1 method. 
    // After compiling this class, run LoadInvoke.exe with MyAssembly.dll 
    // as the command line argument, as shown below:
    // LoadInvoke Myassembly.dllusing System;
    using System.Reflection;
    public class LoadInvoke
    {
        public static void Main(string[] args)
        {
            Assembly a = Assembly.LoadFrom(args[0]);
            Type[] mytypes = a.GetTypes();
            BindingFlags flags = (BindingFlags.NonPublic | BindingFlags.Public | 
                BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly);        foreach(Type t in mytypes)
            {
                MethodInfo[] mi = t.GetMethods(flags);
                Object obj = Activator.CreateInstance(t);            foreach(MethodInfo m in mi)
                {
                    m.Invoke(obj, null);
                }
            }
        }
    }
      

  2.   

    使用反射
    http://expert.csdn.net/Expert/topic/2214/2214138.xml?temp=.7600824
      

  3.   

    看看CSDN里面反射那章,有例子!~