trytry
{
myMethod.Invoke(oService, arg);
                                     ds = (DataSet)arg[0];//加上这个
}
catch(Exception e)
{
MessageBox.Show(e.Message);

解决方案 »

  1.   

    你的ref,或者out,其实还是存放在arg里面,要重新获取下如下方法测试通过Type t = Type.GetType("WindowsApplication1.SB");
    MethodInfo mif = t.GetMethod("xx");
    object obj = System.Activator.CreateInstance(t);
    string s = "";
    object[] args = new object[1]{s};
    mif.Invoke(obj,args);

    MessageBox.Show(args[0].ToString());
    public class SB
    {

    public void xx(ref string s)
    {
    s = "返回!";
    }
    }