Message.State Message.State Message.State Message.State Property

定义

获取此 Message 的当前状态。Gets the current state of this Message.

public:
 property System::ServiceModel::Channels::MessageState State { System::ServiceModel::Channels::MessageState get(); };
public System.ServiceModel.Channels.MessageState State { get; }
member this.State : System.ServiceModel.Channels.MessageState
Public ReadOnly Property State As MessageState

属性值

一个 MessageState,包含了此 Message 的当前状态。A MessageState that contains the current state of this Message.

注解

由于 Message 对象的主体是流,因此只能读取或写入一次。Because the body of a Message object is a stream, it can only be read or written once. 这是通过保持 Message 对象的当前状态来强制实施的。This is enforced by maintaining the current state of the Message object. Message 对象处于 Created 状态时,可读取/写入/复制该对象。A Message object can be read, written, or copied when in the Created state. 其他状态为 ReadWrittenCopied,这意味着相应的操作已经执行过一次。Other states are Read, Written and Copied, which means that the respective action has been performed already once.

适用于