vb.net 中的最大标识符长度是多少?

What is the maximum identifier length in vb.net?

可用于 VB.NET 变量或过程标识符的最大字符数是多少?

根据 MSDN 文章 Declared Element Names (Visual Basic) 元素名称(变量、方法、class 等)的最大长度为 1023 个字符。

An element name in Visual Basic must observe the following rules:

  • It must begin with an alphabetic character or an underscore (_).

  • It must only contain alphabetic characters, decimal digits, and underscores.

  • It must contain at least one alphabetic character or decimal digit if it begins with an underscore.

  • It must not be more than 1023 characters long.

这也适用于完全限定的名称。例如:MyNamespace.SubNamespace.ClassName.MethodName.