【发布时间】:2011-06-11 19:06:06
【问题描述】:
可能的重复:
What does the @ symbol before a variable name mean in C#?
What's the use/meaning of the @ character in variable names in C#?
嗨,
我有一个简单的问题。方法声明中的参数名称之前的“@”字符是什么意思?如下:
protected void Method1(Type1 @arg1, Type2 arg2)
...
我在 .net 3.5 中使用 c#。
谢谢。
【问题讨论】:
-
它是一个转义字符,允许您使用保留字作为标识符。这个问题被问了很多。见:stackoverflow.com/questions/429529/…