Sending a File as a Message (COM)
A version of this page is also available for
4/8/2010
Files can be sent as messages by converting the file to an array of bytes, then sending the byte-array as the body of the message.
Note
Each Message Queuing message can have no more than 4 MB of data.
To send a file as a message
Declare an MSMQQueueInfo, MSMQQueue, and MSMQMessage objects, plus a byte array for the file.
Call MSMQQueueInfo.Open to open the destination queue with send access.
Put the file in the body of the message.
Optional. Set additional message properties.
Call MSMQMessage.Send to send the message to the destination queue.
Call MSMQQueue.Close to close the queue.
See Also
Concepts
MSMQ COM Support
Using the COM Components
MSMQ Security