我正在尝试接收对象的类型,如下所示:
Type type = typeof(Namespace1.SubFolder.Class);
Type type2 = Type.GetType("Namespace1.SubFolder.Class");
为什么 type2 被返回为 null 而 type 被按预期返回?我希望最终从用户选择的字符串值创建一个类。
我正在尝试接收对象的类型,如下所示:
Type type = typeof(Namespace1.SubFolder.Class);
Type type2 = Type.GetType("Namespace1.SubFolder.Class");
为什么 type2 被返回为 null 而 type 被按预期返回?我希望最终从用户选择的字符串值创建一个类。