如何通过发送类,而不是类本身作为参数只是名字来获得一类的类型? [英] How to get the type for a class by sending just the name of the class instead of the class itself as the parameter?

查看:112
本文介绍了如何通过发送类,而不是类本身作为参数只是名字来获得一类的类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

暗淡了为Type =的GetType(类名)将给我的类型。但是,我有类字符串的唯一名字。我想是这样的GetType(1级),这将返回类型。


解决方案

  Type.GetType(1级)


Dim a as Type=GetType(className) would gimme the type. But I have only the name of the class as string. I want something like GetType("class1") which would return the type.

解决方案

Type.GetType("class1")

这篇关于如何通过发送类,而不是类本身作为参数只是名字来获得一类的类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆