如何查看dll中的类型?

发布于 2024-09-14 15:48:45 字数 215 浏览 1 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鹿港小镇 2024-09-21 15:48:45

对于导入,您需要知道命名空间或类型名称(如果不在命名空间中)才能导入它们。但是您可以执行“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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文