共用方式為


MessagePropertyFilter.ConnectorType 屬性

定義

取得或設定值,指出在接收或窺視訊息時是否要擷取 ConnectorType 屬性資訊。

public:
 property bool ConnectorType { bool get(); void set(bool value); };
[System.Messaging.MessagingDescription("MsgConnectorType")]
public bool ConnectorType { get; set; }
[<System.Messaging.MessagingDescription("MsgConnectorType")>]
member this.ConnectorType : bool with get, set
Public Property ConnectorType As Boolean

屬性值

true 表示接收 ConnectorType 資訊,否則為 false。 預設為 false

屬性

範例

下列程式代碼範例示範 屬性的使用 ConnectorType

// Set the queue's MessageReadPropertyFilter property 
// to enable the message's ConnectorType property.
queue->MessageReadPropertyFilter->ConnectorType = true;

// Peek at the message. Time out after ten seconds 
// in case the message was not delivered.
orderMessage = queue->Peek(TimeSpan::FromSeconds(10.0));

// Display the value of the message's 
// ConnectorType property.
Console::WriteLine("Message.ConnectorType: {0}", 
    orderMessage->ConnectorType);
// Set the queue's MessageReadPropertyFilter property to enable the
// message's ConnectorType property.
queue.MessageReadPropertyFilter.ConnectorType = true;

// Peek at the message. Time out after ten seconds in case the message
// was not delivered.
orderMessage = queue.Peek(TimeSpan.FromSeconds(10.0));

// Display the value of the message's ConnectorType property.
Console.WriteLine("Message.ConnectorType: {0}",
    orderMessage.ConnectorType);

備註

ConnectorType當應用程式設定通常由消息佇列所設定的訊息屬性時,需要 類別的 Message 屬性。 它用於下列兩個實例:

  • 當連接器應用程式傳遞訊息時,傳送和接收應用程式需要 , Message.ConnectorType 才能解譯訊息的安全性和通知屬性。

  • 傳送應用程式加密的訊息時, Message.ConnectorType 屬性會通知消息佇列使用對稱密鑰。

適用於

另請參閱