use*_*249 1 .net c# reflection
Type myType = Type.GetType(nameOfTypeString);
DoSomething(typeof(myType));
// signature of DoSomething
DoSomething(Type myType)
Run Code Online (Sandbox Code Playgroud)
抱怨它无法解析myType.
该typeof操作返回的实例Type类.
在这种情况下,您已经拥有了一个实例Type.您应该能够简单地将其传递给方法:
DoSomething(myType);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
523 次 |
| 最近记录: |