问题
Where is the documentation for valid property names in .NET? Obviously things like space, * or & aren't valid in a property name, but where is this documented?
回答1:
http://msdn.microsoft.com/en-us/library/aa664670(VS.71).aspx
From the language spec. Property names are identifiers just like members and functions. Granted, there are standard naming conventions elsewhere that are optional, but greatly encouraged.
回答2:
You can look the information up for a particular language on the platform, here are a few.
C# Language
VB Language
More specifically: C# Property Declaration
回答3:
The rules for valid identifiers apply to the properties as well.
Start looking here: C# Language Specification - 2.4.2 Identifiers
回答4:
http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf for the C#
来源:https://stackoverflow.com/questions/1494106/net-valid-property-names