使用reflection,通过invoke的方式来执行
这是我的一段代码:using System.Reflection;
private void myGetCellFont(long col,long row,ref int size,ref int style,ref string name){
try{
Type t = typeof (AxCELLLib.AxCell);
MethodInfo m = t.GetMethod("DoGetCellFont"); object [] args;
args = new object[5];
args[0] = (int)col;
args[1] = (int)row;
args[2] = null;
args[3] = null;
args[4] = null; object obj = m.Invoke(cell,args); size = Convert.ToInt32(args[2]);
style = Convert.ToInt32(args[3]);
name = Convert.ToString(args[4]);
}
catch(Exception ex){
throw ex;
}
}