ContextStack.Pop 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从堆栈中移除当前对象,并返回其值。
public:
System::Object ^ Pop();
public object? Pop();
public object Pop();
member this.Pop : unit -> obj
Public Function Pop () As Object
返回
从堆栈中删除的对象; null 如果没有对象位于堆栈上。
示例
下面的代码示例演示如何从中 ContextStack删除值。
// Pop each item off the stack.
Object^ item = nullptr;
while ( (item = stack->Pop()) != 0 )
Console::WriteLine( "Value popped from stack: {0}", item );
// Pop each item off the stack.
object item = null;
while( (item = stack.Pop()) != null )
Console.WriteLine( "Value popped from stack: "+item.ToString() );
' Pop each item off the stack.
Dim item As Object = stack.Pop()
While item IsNot Nothing
Console.WriteLine(("Value popped from stack: " + item.ToString()))
item = stack.Pop()
End While