AddressHeaderCollection.AddHeadersTo(Message) 方法

定义

将集合中的标头添加到指定消息的标头中。Adds the headers in the collection to the headers of a specified message.

public:
 void AddHeadersTo(System::ServiceModel::Channels::Message ^ message);
public void AddHeadersTo (System.ServiceModel.Channels.Message message);
member this.AddHeadersTo : System.ServiceModel.Channels.Message -> unit
Public Sub AddHeadersTo (message As Message)

参数

message
Message

向其中添加标头的 MessageThe Message to which the headers are added.

例外

messagenullmessage is null.

示例

下面的代码段演示如何调用此方法。The following code snippet illustrates how to call this method.

注解

这将把当前集合中的标头插入与 MessageHeaders 关联并且可通过 Message 属性访问的 Headers 中。This inserts the headers from the current collection into the MessageHeaders associated with the Message and accessible through the Headers property.

适用于