获取类型? [英] Getting type?

查看:80
本文介绍了获取类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,前几天我发布了一个有关动态加载DLL组件的问题.如果我知道这样的类型(whatever.whatever),它会很好用:

So I posted a question the other day about dynamically loading DLL components. And it works great if I know the type like this(whatever.whatever):

Assembly asm = Assembly.LoadFrom(openFileDialog1.FileName);
Type myType = asm.GetType("whatever.whatever");
UserControl uc = (UserControl)Activator.CreateInstance(myType);
uc.Name = "uc";
this.Controls.Add(uc); 

但是现在我如何在不知道类型的情况下执行此操作?

But now how would I do this without knowing the type before?

谢谢:)

推荐答案

roguemat写道:
roguemat wrote:

但是现在我如何在不知道以前的类型的情况下执行此操作?

But now how would I do this without knowing the type before?



^ ]


这篇关于获取类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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