| 发表于:2007-02-07 16:20:55 楼主 |
相关代码如下: public static object[] findfunction(string methodname, object[] pr) { assembly a = assembly.loadfrom(dllfilepath);//加载dll if (a == null) { throw new exception( "can 't find the file "); } object o = a.createinstance( "namespace.class ");//寻找类 if (o == null) { throw new exception( "can 't create the object "); } methodinfo m = o.gettype().getmethod(methodname);//调用方法 if (m == null) { throw new exception( "can 't find the method of " + methodname); } return (object)m.invoke(o, pr);//执行 } 以下是一个函数的原型: public static int checkusercanlogin(object [] pr, out string username) 以下是调用: findfunction( "checkusercanlogin ", new object[] { pr, username }); 问题是: 怎么获取最后一个返回参数的值. |
|
|
|
|