反射中Type t = Type.GetType(classname),在同一个解决方案下的不同项目之间操作,classname这个命名空间+类名怎么写
1. 如果项目引用了 项目名.dll
Type type = Type.GetType("命名空间.类名, 命名空间");
2. 如果项目没有引用 项目名.dll
Assembly assm = Assembly.LoadFrom("项目名.dll");
Type type = assm.GetType("命名空间.类名");
//方法唯一,不能有多个不同参数的方法
System.Reflection.MethodInfo method = type .GetMethod("方法名")
1. 如果项目引用了 项目名.dll
Type type = Type.GetType("命名空间.类名, 命名空间");
2. 如果项目没有引用 项目名.dll
Assembly assm = Assembly.LoadFrom("项目名.dll");
Type type = assm.GetType("命名空间.类名");
//方法唯一,不能有多个不同参数的方法
System.Reflection.MethodInfo method = type .GetMethod("方法名")