MsmqMessage<T>.Id 属性

定义

获取一个 String,它包含此消息的消息标识符。Gets a String that contains the message identifier for this message.

public:
 property System::String ^ Id { System::String ^ get(); };
public string Id { get; }
member this.Id : string
Public ReadOnly Property Id As String

属性值

String

一个 String,它包含此消息的消息标识符。A String that contains the message identifier for this message.

示例

string MessageId = message.Id;
Dim MessageId = message.Id

注解

此属性只可在发送消息之后访问。This property can only be accessed after the message is sent.

发送消息时,消息队列 (MSMQ) 会生成消息的消息标识符。Message Queuing (MSMQ) generates a message identifier for the message when it is sent. 该标识符长度为 20 个字节,其中包括部分:发送计算机的计算机 GUID 和消息在发送计算机上的唯一标识符。The identifier is composed of 20 bytes and includes two parts: the machine GUID of the sending computer, and a message identifier that is unique on the sending computer. 这两部分组合在一起,就产生了一个在网络上唯一的消息标识符。The combination of these two parts forms a message identifier that is unique on the network.

消息队列会为所有消息生成消息标识符,其中包括确认消息和报告消息。Message Queuing generates message identifiers for all messages, including acknowledgment and report messages. 消息队列会发送确认消息,以作为对应用程序发送的消息的到达或失败的响应。Message Queuing sends an acknowledgment message in response to the arrival or failure of a message that is sent by an application.

适用于