.NET Framework Bookmark and Share   
 index > .NET Base Class Library > Can i use bodystream and body together in msmq
 

Can i use bodystream and body together in msmq

hello everybody:

I want to set the bodystream and body property in Message of msmq like below

Message m = new Message();

m.Body = "This message have a file attechment";

m.BodyStream = new FileStream(filePath);

but when i read the bodystream,every byte in it is zero,I want to know whether msmq can use bodystream and body at the same time?

Thanks.

JunandJun
in http://msdn2.microsoft.com/en-us/library/system.messaging.message.body(VS.71).aspx

I find that "Specify either the Body property or the BodyStream property before sending the Message object",so I think

I can't use body and bodystream at the same time.

in fact,I want to send a message that can attach a file,now I find anthor message property that is extension,I can use it attach a file.

JunandJun
You need to reset the stream before you read from it.
ucurello

You can use google to search for other answers

Custom Search

More Threads

• The name of connection string
• terminate thread
• Shared Library
• How to convert string to datetime value
• asynchronous operations issues....
• How I can check path?
• TaskManager
• Inteface with Smart Card reader
• No Events on Serialport
• Generics Question