在C#中怎样不使用引用的方式调用C#的dll,注意不是引用的方式,谢谢各位

解决方案 »

  1.   

    谢谢各位,补充一下假若a,b用c#写的文件,a为exe,b为dll,现在a要调用b,不要在a中通过项目添加引用b的方式,直接通过代码语句来调用b.dll
      

  2.   

    Assembly asmA = Assembly.LoadFrom("***.dll");
                string strClass = string.Empty;
                if (null != asmA )
                {
                    strClass = "A.Service.Test";
                    try
                    {
                        Type typeTest = asmA.GetType(strClass);
                        object obj = Activator.CreateInstance(typeTest);                    System.Reflection.MethodInfo miMethod = typeTest.GetMethod("Initialize");
                        miMethod.Invoke(obj,null);
                    }
                    catch (Exception e)
                    {
                        throw e;
                    }
                }