gpt4 book ai didi

c# - 如何从 Type 的名称中获取 Type 对象?

转载 作者:行者123 更新时间:2023-11-30 20:12:52 25 4
gpt4 key购买 nike

这是我的代码:

using System.Windows.Forms;

Type type = typeof(Form);
Type type2 = Type.GetType(type.FullName);

结果:type2==null

我做错了什么?

最佳答案

也许你可以试试:

Type type2 = Type.GetType(type.AssemblyQualifiedName);

关于c# - 如何从 Type 的名称中获取 Type 对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2117050/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com