Marshal.GenerateGuidForType 与 GetType().GUID 不同吗?

发布于 2024-11-29 07:55:51 字数 219 浏览 2 评论 0原文

只是想知道这两种方法是否可以实现同一目标?

注意:GetType().GUID 可以获取 GuidAttribute 。那么 Marshal.GenerateGuidForType 方法是否做了任何额外的事情?

[Guid("DC05F01B-32FC-4CCE-AC0D-854E8B6471FC")]

just wondering if these are two methods to achieve the same thing?

note: GetType().GUID picks up the GuidAttribute okay. So is the Marshal.GenerateGuidForType method doing anything extra?

[Guid("DC05F01B-32FC-4CCE-AC0D-854E8B6471FC")]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

亚希 2024-12-06 07:55:51

查看 Marshal 的文档.GenerateGuidForType()

GenerateGuidForType 提供与 Type.GUID 属性相同的功能。

Have a look at the documentation for Marshal.GenerateGuidForType():

GenerateGuidForType provides the same functionality as the Type.GUID property.

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