更新:2007 年 11 月
错误消息
关键字“this”在静态属性、静态方法或静态字段初始值设定项中无效
示例
下面的示例生成 CS0026:
// CS0026.cs
public class A
{
public static int i = 0;
public static void Main()
{
// CS0026
this.i = this.i + 1;
// Try the following line instead:
// i = i + 1;
}
} | |