c# 对COM+对象反射调用时地址参数处理 c# 对COM+对象反射调用时地址参数处理
try
???{
????DataSet ds=new DataSet ();
????Type objType;
????object objBinding;
????objType = Type.GetTypeFromProgID("CSGPDBAccess.CSGPDBAccess");
????objBinding = Activator.CreateInstance(objType);
????Type[] paramTypes = new Type[] {Type.GetType("System.String"), Type.GetType("System.Int32"), Type.GetType("System.String[]&")};
???
????MethodInfo m = objType.GetMethod("openProcedure",paramTypes);
????????object[] args = new object[3];
?????args[0] = "Test";
????args[1] = 1;
????args[2] = new string[]{"0052005"};
??
????ds=(DataSet)m.Invoke(objBinding,args);
???
????if(ds.Tables.Count>0 )
????{
?????dataGrid1.DataSource=ds.Tables[0].DefaultView ;
????}
???}
???catch(TargetInvocationException ee)
???{
????MessageBox.Show(ee.Message);
???}
總結
以上是生活随笔為你收集整理的c# 对COM+对象反射调用时地址参数处理 c# 对COM+对象反射调用时地址参数处理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Tiray.SMSTiray.SMSTi
- 下一篇: Viewport3D 类Viewport