OpCodes.Throw 字段


引发当前位于计算堆栈上的异常对象。Throws the exception object currently on the evaluation stack.

public: static initonly System::Reflection::Emit::OpCode Throw;
public static readonly System.Reflection.Emit.OpCode Throw;
 staticval mutable Throw : System.Reflection.Emit.OpCode
Public Shared ReadOnly Throw As OpCode 



下表列出了指令的十六进制和 Microsoft 中间语言(MSIL)程序集格式以及简短的参考摘要:The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:

格式Format 程序集格式Assembly Format 说明Description
7A7A throwthrow 引发异常。Throws an exception.

堆栈转换行为顺序如下:The stack transitional behavior, in sequential order, is:

  1. 将对象引用(对异常)推送到堆栈上。An object reference (to an exception) is pushed onto the stack.

  2. 从堆栈中弹出对象引用并引发异常。The object reference is popped from the stack and the exception thrown.

@No__t-0 指令引发当前堆栈上的异常对象(类型 O)。The throw instruction throws the exception object (type O) currently on the stack.

如果对象引用为空引用,则会引发 NullReferenceExceptionNullReferenceException is thrown if the object reference is a null reference.

以下 @no__t 0 方法重载可以使用 @no__t 操作码:The following Emit method overload can use the throw opcode:

  • ILGenerator.Emit(OpCode)ILGenerator.Emit(OpCode)