473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

not able to receive a .txt file from a message queue (MSMQ)

Hi ,

I am able to send a text file (.txt) to a message queue (MSMQ).
But i am not able to receive the .txt file from the message queue. Please help how to proceed.

I am Using BodyStream property to send the content of the text file. In the message queue am able to see the content data present. I think by default MSMQ uses xmlformatter.

Below is code for sending i have used
-------------------------------------------------------
System.Messaging.Message mm = new System.Messaging.Message();
string path = @"EDID93ADES.txt";
System.IO.FileStream stream = new System.IO.FileStream(path, System.IO.FileMode.Open);
mm.BodyStream = stream;
mm.Label = System.IO.Path.GetFileName(path);
mm.Priority = MessagePriority.Normal;
mq.Send(mm);

for Receiving the code i have used
-------------------------------------------------

System.Messaging.Message mes;
string m;
mq1 = new System.Messaging.MessageQueue(@".\Private$\MyQueue ");
try
{

mes = mq1.Receive(new TimeSpan(0, 0, 3));
mes.Formatter = new XmlMessageFormatter(new String[] { "System.String,mscorlib" });
m = mes.Body.ToString();


}
catch
{
m = "No Message";
}

Please help out of this...

It will be a great help full

Thanks,
Thaj
Nov 4 '09 #1
0 1440

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Stephen Barrett | last post by:
Does anyone know of any good sites or books to read up on using Windows Message Queue with .Net? I am starting to convert a long standing PowerBuilder server application to .Net. The current...
1
by: **** KiteOregon **** | last post by:
I need to send & receive XML Document Objects via the Message Queue. We have several applications that insert XML Document Object into the message queue. This works with no problem. I am trying...
4
by: Robert Rossney | last post by:
I'm trying to send and receive XmlDocument objects using the System.Messaging.dll functions. The code I've written follows, as best I can tell, the methodology used in the sample code for the...
3
by: Vai2000 | last post by:
hi all, I have a winsvc which reads of messages out an MSMQ. Can someone help with this problem. If my server goes down and comes back up my WinSvc doesn't picks up messages accumulated in the...
4
by: Just D. | last post by:
Did anybody use this Message Queuing and knew all details about it? What's the physical limit of this Message Queuing system, number of messages, mbytes, message size? Where it stores messages,...
2
by: DBC User | last post by:
Hi All, I am going to develop two application which will talk to each other using MSMQ. I have couple of questions 1. Do we need to install anything extra in client PC to use MSMQ? Since...
0
by: TweetyRocks | last post by:
Hi All, I have 2 Dot Net Windows services. The 1st service inserts a message into an MSMQ queue. The second service picks it up from the queue and processes it. It then removes it from the queue...
1
by: Wazza | last post by:
G'Day, I have a re-occurring problem and wish to design a framework or pattern to address it. I have some Ideas but I would like to do some brainstorming with my peers before commencing. The...
1
by: cmrhema | last post by:
Hi, All I have a program in C# where I am reading all the messages from a MSMQ. I have declared a class Queue as below public class MyQueue { public static Queue myqueue;...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.