Throws the exception object currently on the evaluation stack.
[Visual Basic] Public Shared ReadOnly Throw As OpCode [C#] public static readonly OpCode Throw; [C++] public: static OpCode Throw; [JScript] public static var Throw : OpCode;
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:
|7A||throw||Throws an exception.|
The stack transitional behavior, in sequential order, is:
- An object reference (to an exception) is pushed onto the stack.
- The object reference is popped from the stack and the exception thrown.
The throw instruction throws the exception object (type O) currently on the stack.
NullReferenceException is thrown if the object reference is a null reference.
The following Emit constructor overload can use the throw opcode:
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family