在 VB.NET 中,我可以将函数标记为已弃用吗?

发布于 2024-07-14 15:34:13 字数 99 浏览 3 评论 0原文

VB.NET 是否有能力弃用代码? 我知道在C#中有“属性”,在java中有标签; 除了留下 'todo:... 之外,VB.NET 中还有类似的东西吗?

Is there an ability in VB.NET to deprecate code?
I know that in C# there are 'attributes', and tags in java; is there anything similar in VB.NET, other than leaving a 'todo:...?

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

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

发布评论

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

评论(2

机场等船 2024-07-21 15:34:13

VB.NET 中也有属性:

看起来像这样(在您的函数之前)

<Obsolete("This method is deprecated, use XXXX instead.")> _ 

并且从 VB.NET 10(.NET 4 及更高版本)开始,我们< a href="https://msdn.microsoft.com/en-us/library/ff637436.aspx" rel="noreferrer">不再需要下划线。

<Obsolete("This method is deprecated, use XXXX instead.")>

There are attributes in VB.NET too:

Looks like this (before your function)

<Obsolete("This method is deprecated, use XXXX instead.")> _ 

And since VB.NET 10 (.NET 4 and later) we no longer need the underscore.

<Obsolete("This method is deprecated, use XXXX instead.")>
童话里做英雄 2024-07-21 15:34:13

使用[已过时] 属性。

Use the [Obsolete] Attribute.

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