Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 MSDN 上进行了快速检查,然后在此处进行了快速搜索,但我没有找到任何明确说明 .net 资源字符串名称中允许/不允许哪些字符的内容。目前我正在尝试找出是否允许使用“:”,但我更愿意找到一些涵盖所有情况的参考。
资源名称上不允许使用冒号。如果你尝试一下,你会得到
资源名称 XX:XXX 不是有效标识符
对于资源名称应用与变量相同的规则。如果您检查该.designer文件,您会看到为您定义的每个字符串资源创建了一个属性,因此它需要遵循相同的命名规则。
.designer