473,505 Members | 15,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending a file with MSMQ

can I send a file with MSMQ

If yes then do you have an example

Thanks.
Nov 20 '05 #1
1 4161
Rami,
Do you want to send the contents of the file or do you want to send the file
name?

To send the contents of a file, the "easiest" way is to set the BodyStream
property of the message.

Dim theQueue As System.Messaging.MessageQueue

Dim thePath As String = "c:\myfile.txt"
Dim theStream As New System.IO.FileStream(thePath, IO.FileMode.Open)
Dim theMessage As New Message

theMessage.BodyStream = theStream
theMessage.Label = System.IO.Path.GetFileName(thePath)
theMessage.Priority = MessagePriority.Normal
theQueue.Send(theMessage)

The send the file name, you can simply use:

Dim theMessage As New Message(thePath)
theMessage.Label = System.IO.Path.GetFileName(thePath)
theMessage.Priority = MessagePriority.Normal
theQueue.Send(theMessage)

Hope this helps
Jay

"Rami" <an*******@discussions.microsoft.com> wrote in message
news:EC**********************************@microsof t.com...
can I send a file with MSMQ.

If yes then do you have an example.

Thanks.

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2111
by: Joshua Burvill | last post by:
Hello, I am trying to print something to a print server using the following function but I get errors, does anyone have any pointers? Rgds, Josh Traceback (most recent call last): File...
2
1352
by: Magnus Blomberg | last post by:
Hello! I am developing a C# windows application that should send a file using FTP. Does anyone knows how to make my application do this. I haven't found the correct object to perform this. It...
1
2987
by: Michael McGarrigle | last post by:
I would like to send the contents of a file using xp_sendmail however I do not want the file contents to be an attachment. I have no problem sending the file as an attachement. Can anybody give me...
1
5366
by: BillLin | last post by:
I am new to MS Access VBA. I am doing an Access porject with the function of generating funding files in a required format in a folder and then attaching it to an email (with the number of...
1
1807
by: Henk | last post by:
Hi, I have a problem with sending a file. I have a client application that connects to a server and sends the string "data". Then it sends a file. If the server receives "data", the method...
4
1772
by: AtulSureka | last post by:
Hi, I have file of relatively larger size (4-5 Mbs) on client machine. I want to send this file to Server. For this I am using web services. Following is my perception, Please correct me if I...
2
2638
by: Sean | last post by:
Hi guys, I have a question. I am trying to write a simple echo program. The objective is to read in a file in chuncks into the buffer and transfer the buffer over the socket. We repeat this until...
0
1130
by: duclm | last post by:
Hi all, II am having problem sending zip file(binary file) using webrequest function from wince5.0 device to a webpage. It works fine for any file with size less than or equal to 1.5kb. Any bigger...
1
1313
by: Obaum1 | last post by:
Hello I am sending a file to a webservice after i transform him to byte And when i am sending a very large file(400 MB) i get an Exception of type 'System.OutOfMemoryException' was thrown. ...
7
1817
by: koneyji | last post by:
hi i have following code to send file and its giving file io error namespace client_server { class Program { static void Main(string args) { IPAddress ip...
0
7216
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
7367
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...
1
7018
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5028
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4699
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
407
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.