Getting a System.Type from type's partial name

前端 未结 7 809
梦谈多话
梦谈多话 2020-11-27 07:18

I want to get a System.Type given only the type name in a string.

For instance, if I have an object:

MyClass abc = new MyCl         


        
相关标签:
7条回答
  • 2020-11-27 07:58

    Type.GetType(...)might fail sometimes if the typeof operator can not be used.

    Instead you can reflect on the assemblies from the current domain in order to do it.

    check my response on this thread

    0 讨论(0)
提交回复
热议问题