如何查看dll中的类型?
import clr
clr.AddReferenceToFileAndPath(r'E:\MyDocuments\Surface Extension\Samples\test.dll')
但是,如何查看 test.dll 中的类型。
我得到的导入测试
: 错误:没有名为 test 的模块
我应该知道 test.dll 中的类型吗?
import clr
clr.AddReferenceToFileAndPath(r'E:\MyDocuments\Surface Extension\Samples\test.dll')
But, How to watch the types in the test.dll.
import test
I got :
error: No module named test
Shold I must know the types in the test.dll??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于导入,您需要知道命名空间或类型名称(如果不在命名空间中)才能导入它们。但是您可以执行“test = clr.LoadAssemblyFromFileWithPath(...)”,这将返回一个程序集对象。在 IronPython 中,程序集对象支持点划线,因此您可以直接从该对象访问命名空间/类型。
For import you need to know the namespaces or type names if not in a namespace to import them. But you can do "test = clr.LoadAssemblyFromFileWithPath(...)" which will return an assembly object. In IronPython assembly objects support dotting through them so you could then access the namespaces/types directly from that object.