Visual Basic 2005 中的全局关键字?

发布于 2024-07-26 01:39:48 字数 366 浏览 2 评论 0原文

我必须继承公司中的一些遗留代码,这些代码是用Visual Basic.NET 7.0(Visual Studio.NET 2002)编写的。 我在 VB.NET 方面没有太多经验,这行代码给我带来了麻烦:

Public Class Global : Inherits System.Web.HttpApplication

Visual Studio 给出了这个错误:错误 31 关键字作为标识符无效。 C:\Documents and Settings\Administrator\Desktop\POMan\WebApplication1\Global.asax.vb 4 14 C:...\POMan\

如何修复此问题?

I have to inherit some legacy code in company, which is written in Visual Basic.NET 7.0 (Visual Studio.NET 2002). I don't have much experiences in VB.NET, and this line of code gets me in trouble:

Public Class Global : Inherits System.Web.HttpApplication

Visual Studio gave this error: Error 31 Keyword is not valid as an identifier. C:\Documents and Settings\Administrator\Desktop\POMan\WebApplication1\Global.asax.vb 4 14 C:...\POMan\

How can I fix this?

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

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

发布评论

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

评论(2

夏尔 2024-08-02 01:39:48

如果您真的想将其称为“全局”,请使用 [Global],尽管我建议更改名称。

如果您继续将其称为全局,那么还要注意对该类的任何引用都需要以名称空间为前缀。

If you really really want to call it Global, then use [Global], although I would recommend changing the name instead.

If you continue to call it Global, then be aware also that any reference to the class will need to be prefixed with the namespace.

月依秋水 2024-08-02 01:39:48

将名称 Global 更改为更具描述性的名称,这样就不会发生冲突。

Change the name Global to be something more descriptive, so that it doesn't clash.

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