Reflection

xiaoxiao2021-03-06  117

// 2003-1-9 Yushu ?? // Connected to the panel controlled the panel connection ??? system.reflection.Assembly assem; ??? asm = system.reflection.assembly.load ("Oceansoft.ssLoadXML) ; ????? String Typename = ""; ??? Type [] mytype = askEM.GETTYPES (); ??? foreach (type m in mytype) ??? {??? ? Typename = m.name.toString (); ???? = mItem ["panelinkurl"]. TOSTRINK (). Trim ()) // Dynamic call class ???? {?????? Hellotype = m; ????? Object obj = activator.createInstance (Hellotype); ???? // ????? // Set which panel // ????? PropertyInfo Ppropertydll3 = Hellotype. GetProperty ("useertype"); // ????? // assignment // ????? Object [] argsproperty3; // ????? argsproperty3 = new object [1];? //??? ?? argsproperty3 [0] = mitem ["panelinkurl"]. TOSTRING (). Trim (); // ????? ppropertydll3.setValue (Obj, argsproperty3 [0], null;

????? // Set the property value user's Guid ????? PropertyInfo Ppropertydll1 = Hellotype.GetProperty ("Userguid"); ????? // Assignment ????? Object [] argsproperty1;?? ??? argsproperty1 = new object [1]; ?????? argsproperty1 [0] = session ["WAF_USERGUID"]. TOSTRING (); ????? ppropertydll1.setValue (Obj, argsproperty1 [0], NULL );

????? // call function (return value) ????? MethodInfo Pmethod1 = Hellotype.getMethod ("iGetdata");

????? Object [] argsmax = new object [0]; ????????????? // incoming parameter ????? Object [] argsreturnmax = new Object [1] ; ??? // Return to the number of parameters ????? argsreturnmax [0] = pmethod1.invoke (obj, argsmax) ;? // Return value ???????? strXml = (String) argsreturnMax [ 0]; ????} ???} ?? doc.loadXML (STRXML);

?? // end

转载请注明原文地址:https://www.9cbs.com/read-126392.html

New Post(0)