C#中_Default关键字是什么意思

发布于 2024-08-21 18:44:02 字数 144 浏览 4 评论 0原文

例如,我创建了一个网页,其中包含 _Default 关键字。

public partial class _Default : System.Web.UI.Page 

该关键字在这里起什么作用?有什么意义呢?

For example, I have created a webpage and it has _Default keyword in it.

public partial class _Default : System.Web.UI.Page 

What does that keyword do in here? What is the point ?

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

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

发布评论

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

评论(4

双手揣兜 2024-08-28 18:44:02

_Default 不是关键字,而是你的类名。

_Default isn't a keyword, it's your class name.

回忆那么伤 2024-08-28 18:44:02

default 是 C# switch 语句中使用的关键字,在 VB.Net 中适用于默认属性。这就是 IDE 根据页面名称 (Default.aspx) 将类重命名为 _Default 的原因。 _Default 本身不是关键字,并且颜色似乎有所不同,因为该行上的所有其他单词都是关键字。

default is a keyword used in the C# switch statement, and in VB.Net applies to a default property. That's why the IDE renamed your class _Default, based on the name of the page (Default.aspx). _Default is in itself not a keyword, and appears to be colored differently because every other word on that line is a keyword.

絕版丫頭 2024-08-28 18:44:02

它不是关键字,而是类的名称。变量名称可以以 az、AZ 和“_”开头。

It is not a keyword, that is the name of the class. Variable names can start with a-z, A-Z, and '_'.

つ可否回来 2024-08-28 18:44:02

关键字名称是小写的。这是你的班级名称。如果你的页面名称是默认的,asp.net 会将此名称添加到它的类中。

keyword names are lowercase. this is your class name. if your page name is default, asp.net get this name to it's class.

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