更新:2007 年 11 月
错误消息
as 运算符必须与引用类型或可为 null 的类型一起使用(“int”是不可为 null 的值类型)。向 
下面的示例生成 CS0077:
// CS0077.cs
using System;
class C
{
}
struct S
{
}
class M
{
   public static void Main()
   {
      object o1, o2;
      C c;
      S s;
      o1 = new C();
      o2 = new S();
      s = o2 as S;  // CS0077, S is not a reference type.
      // try the following line instead
      // c = o1 as C;
   }
} | |