什么是'@'之前在方法声明中的参数名称char是什么意思?声明、名称、参数、方法

2023-09-07 03:42:59 作者:官方小仙

可能显示的文件:   What没有一个变量名前的@符号在C#是什么意思?   What's在C#中的变量名的@符号的使用/含义?

Possible Duplicates: What does the @ symbol before a variable name mean in C#? What's the use/meaning of the @ character in variable names in C#?

您好,

我有一个快速的问题。什么是'@'之前在方法声明中的参数名称char是什么意思?就像下面的:

I have one quick question. What does '@' char mean before parameter name in method declaration? Like following:

protected void Method1(Type1 @arg1, Type2 arg2)
...

我使用C#与.NET 3.5。

I use c# with .net 3.5.

感谢。

推荐答案

它允许保留字用作标识符。它通常用它可能使用源名称,从不同的关键字比目标语言,如系统code发电机表名和存储过程的参数名称。

It allows reserved words to be used as identifiers. It is usually used by code generators which may be using source names from systems with different keywords than the target language e.g. table names and sproc argument names.