共用方式為


MSMQMessage

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

The MSMQMessage object provides access to the properties that define a message and the methods used to send the message to its destination queue.

Note

The Send method listed below is used for both transactional and nontransactional messages (for information on its use in transactions, see Transactions).

The body of a message can be a string, an array of bytes, any numeric date or currency type that a Variant can contain, or any persistent COM object that supports IDispatch and IPersist (IPersistStream, IPersistStreamInit, or IPersistStorage).

Methods

The MSMQMessage object defines the following methods.

Method Description
MSMQMessage.AttachCurrentSecurityContext (Superseded by AttachCurrentSecurityContext2.) Caches an internal or external certificate and the corresponding private key in a security context structure along with the user's SID and additional security information needed to attach a certificate for sending authenticated messages. Stores the handle to this structure in the object.
MSMQMessage.AttachCurrentSecurityContext2 (Introduced in Windows® 2000 Service Pack 2; supersedes MSMQMessage.AttachCurrentSecurityContext.) Caches an internal or external certificate and the corresponding private key in a security context structure along with the user's SID and additional security information needed to attach a certificate for sending authenticated messages. Stores the handle to this structure in the object.
MSMQMessage.Send Sends the message to the specified queue.

Properties

The MSMQMessage object defines the following properties.

Property Description
MSMQMessage.Ack Specifies the type of acknowledgment messages that Message Queuing returns to the administration queue.

Run-time access: Read/write

Data type: Long
MSMQMessage.AdminQueueInfo Specifies the queue used for acknowledgment messages.

Run-time access: Read/write

Data type: MSMQQueueInfo
MSMQMessage.AppSpecific Specifies application-generated information for filtering messages.

Run-time access: Read/write

Data type: Long
MSMQMessage.ArrivedTime Provides the date and time when the message arrived at the queue. Run-time access: Read-only

Data type: Variant (Date)
MSMQMessage.AuthenticationProviderName (Introduced in MSMQ 2.0.) Specifies the name of the cryptographic provider used to generate the digital signature attached to the message.

Run-time access: Read/write

Data type: String
MSMQMessage.AuthenticationProviderType (Introduced in MSMQ 2.0.) Specifies the type of cryptographic provider used to generate the digital signature attached to the message.

Run-time access: Read/write

Data type: Long
MSMQMessage.AuthLevel Specifies whether the message should be authenticated and what type of digital signature is used.

Run-time access: Read/write

Data type: Long
MSMQMessage.Body Specifies the body of the message.

Run-time access: Read/write

Data type: Variant
MSMQMessage.BodyLength Provides the size of the message body.

Run-time access: Read-only

Data type: Long
MSMQMessage.Class (Superseded by MsgClass.) Provides the type of message.

Run-time access: Read-only

Data type: Long
MSMQMessage.CompoundMessage (Introduced in MSMQ 3.0.) Provides the entire contents of an SRMP message, including the SOAP envelope and the SOAP attachments associated with it.

Run-time access: Read-only

Data type: Variant (array of bytes)
MSMQMessage.ConnectorTypeGuid (Introduced in MSMQ 2.0.) Specifies a connector application identifier. This property is set when some properties typically set by Message Queuing were set by the sending application.

Run-time access: Read/write

Data type: String (GUID format)
MSMQMessage.CorrelationId Specifies the correlation identifier of the message.

Run-time access: Read/write

Data type: Variant (array of bytes)
MSMQMessage.Delivery Specifies how the message is delivered (optimize throughput or recoverability).

Run-time access: Read/write

Data type: Long
MSMQMessage.Destination Provides the set of destination queues to which the message was originally sent.

Run-time access: Read-only

Data type: MSMQDestination
MSMQMessage.DestinationQueueInfo Provides the queue to which the message is originally sent.

Run-time access: Read-only

Data type: MSMQQueueInfo
MSMQMessage.DestinationSymmetricKey (Introduced in MSMQ 2.0.) Specifies the symmetric key used to encrypt the message.

Run-time access: Read/write

Data type: Variant (array of bytes)
MSMQMessage.EncryptAlgorithm Specifies the algorithm used to encrypt the message body.

Run-time access: Read/write

Data type: Long
MSMQMessage.Extension (Introduced in MSMQ 2.0.) Specifies additional application-defined information.

Run-time access: Read/write

Data type: Variant (array of bytes)
MSMQMessage.HashAlgorithm Specifies the hashing algorithm that Message Queuing uses when authenticating the message.

Run-time access: Read/write

Data type: Long
MSMQMessage.Id Provides the MSMQ-generated identifier for the message. Run-time access: Read-only

Data type: Variant (array of bytes)
MSMQMessage.IsAuthenticated (Superseded by IsAuthenticated2.) Indicates whether the message was authenticated at the request of the sending application.

Run-time access: Read-only

Data type: Short
MSMQMessage.IsAuthenticated2 (Introduced in MSMQ 3.0, supersedes IsAuthenticated.) Indicates whether the message was authenticated at the request of the sending application.

Run-time access: Read-only

Data type: Boolean
MSMQMessage.IsFirstInTransaction (Introduced in MSMQ 2.0, superseded by IsFirstInTransaction2.) Indicates whether the message was the first message in a transaction.

Run-time access: Read-only

Data type: Short
MSMQMessage.IsFirstInTransaction2 (Introduced in MSMQ 3.0, supersedes IsFirstInTransaction.) Indicates whether the message was the first message in a transaction, as a Boolean value.

Run-time access: Read-only

Data type: Boolean
MSMQMessage.IsLastInTransaction (Introduced in MSMQ 2.0, superseded by IsLastInTransaction2.) Indicates whether the message was the last message in a transaction.

Run-time access: Read-only

Data type: Short
MSMQMessage.IsLastInTransaction2 (Introduced in MSMQ 3.0, supersedes IsLastInTransaction.) Indicates whether the message was the last message in a transaction, as a Boolean value.

Run-time access: Read-only

Data type: Boolean
MSMQMessage.Journal Specifies whether a copy of the message is stored in the computer journal.

Run-time access: Read/write

Data type: Long
MSMQMessage.Label Specifies an application-defined label for the message.

Run-time access: Read/write

Data type: String
MSMQMessage.LookupId (Introduced in MSMQ 3.0.) Provides the lookup identifier of the message.

Run-time access: Read-only

Data type: Variant (String)
MSMQMessage.MaxTimeToReachQueue Specifies how long the message has to reach the queue.

Run-time access: Read/write

Data type: Long
MSMQMessage.MaxTimeToReceive Specifies how long the receiving application has to remove the message from the queue.

Run-time access: Read/write

Data type: Long
MSMQMessage.MsgClass (Introduced in MSMQ 2.0, supersedes Class.) Specifies the type of message.

Run-time access: Read/write

Data type: Long
MSMQMessage.Priority Specifies the priority of the message (where it is placed in the queue).

Run-time access: Read/write

Data type: Long
MSMQMessage.PrivLevel Specifies whether the message is private (encrypted).

Run-time access: Read/write

Data type: Long
MSMQMessage.ReceivedAuthenticationLevel (Introduced in MSMQ 2.0.) Indicates whether the message was authenticated at the request of the sending application and what type of digital signature was used.

Run-time access: Read-only

Data type: Short
MSMQMessage.ResponseDestination (Introduced in MSMQ 3.0.) Specifies a set of queues used for returning response messages.

Run-time access: Read/write

Data type: MSMQDestination
MSMQMessage.ResponseQueueInfo Specifies the queue for sending responses to the message.

Run-time access: Read/write

Data type: MSMQQueueInfo
MSMQMessage.SenderCertificate Specifies the sender certificate. .

Run-time access: Read/write

Data type: Variant (array of bytes)
MSMQMessage.SenderId Identifies the user who sent the message.

Run-time access: Read/write

Data type: Variant (array of bytes)
MSMQMessage.SenderIdType Specifies the type of sender identifier found in SenderId.

Run-time access: Read/write

Data type: Long
MSMQMessage.SenderVersion (Introduced in MSMQ 3.0.) Specifies the wire format used to send the message.

Run-time access: Read-only

Data type: Long
MSMQMessage.SentTime Provides the date and time when the message was sent.

Run-time access: Read-only

Data type: Variant (Date)
MSMQMessage.Signature (Introduced in MSMQ 2.0.) Specifies the MSMQ 1.0 signature or application-generated signature that is attached to the message.

Run-time access: Read/write

Data type: Variant (array of bytes)
MSMQMessage.SoapBody (Introduced in MSMQ 3.0.) Specifies application-generated SOAP body elements for inclusion in the SOAP envelope of an SRMP message.

Run-time access: Write-only

Data type: String
MSMQMessage.SoapEnvelope (Introduced in MSMQ 3.0.) Provides the SOAP envelope (not including binary attachments) of an SRMP message.

Run-time access: Read-only

Data type: String
MSMQMessage.SoapHeader (Introduced in MSMQ 3.0.) Specifies additional application-generated header elements for inclusion in the SOAP envelope of an SRMP message.

Run-time access: Write-only

Data type: String
MSMQMessage.SourceMachineGuid Provides the identifier of the computer where the message originated.

Run-time access: Read-only

Data type: String (GUID format)
MSMQMessage.Trace Specifies whether the route of the message is traced.

Run-time access: Read/write

Data type: Long
MSMQMessage.TransactionId (Introduced in MSMQ 2.0.) Provides the transaction identifier for the message.

Run-time access: Read-only

Data type: Variant (array of bytes)
MSMQMessage.TransactionStatusQueueInfo (Introduced in MSMQ 2.0.) Provides the transaction status queue.

Run-time access: Read-only

Data type: MSMQQueueInfo

Requirements

Windows NT/2000/XP: Included in Windows NT 4.0 SP3 and later.

Windows 95/98/Me: Included in Windows 95 and later.

Header: Declared in Mqoai.h.

Library: Use Mqoa.lib

See Also

Message Queuing COM Components