📜  C# GetType - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:38.055000             🧑  作者: Mango

代码示例2
public static Type GetType(string typeName)
{
    var type = Type.GetType(typeName);
    if (type != null) return type;
    foreach (var a in AppDomain.CurrentDomain.GetAssemblies())
    {
        type = a.GetType(typeName);
        if (type != null)
            return type;
    }
    return null;
}