473,657 Members | 2,735 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 4168
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.Messagin g.MessageQueue

Dim thePath As String = "c:\myfile. txt"
Dim theStream As New System.IO.FileS tream(thePath, IO.FileMode.Ope n)
Dim theMessage As New Message

theMessage.Body Stream = theStream
theMessage.Labe l = System.IO.Path. GetFileName(the Path)
theMessage.Prio rity = MessagePriority .Normal
theQueue.Send(t heMessage)

The send the file name, you can simply use:

Dim theMessage As New Message(thePath )
theMessage.Labe l = System.IO.Path. GetFileName(the Path)
theMessage.Prio rity = MessagePriority .Normal
theQueue.Send(t heMessage)

Hope this helps
Jay

"Rami" <an*******@disc ussions.microso ft.com> wrote in message
news:EC******** *************** ***********@mic rosoft.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
2119
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 "<pyshell#2>", line 1, in ?
2
1360
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 should connect, login, upload the file, and then disconnect. If possible I also want to add a progress bar to the transfer. Any ideas? Regards Magnus
1
2999
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 an xp_sendmail example of how to do this. The results of a query can easily appear in the body of the email but all my attempts to include the contents of a file in the body of the email have not worked. TIA
1
5376
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 transactions and their totals) and sending it to a number of receipiants. Can anybody give me a hints on how to use Access VBA to send email with attachment? Thanks a lot in advance.
1
1830
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 getCsv() is started (this receives the file) The file however isn't received completely (most of the time) this is my servercode:
4
1783
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 am wrong There can be two approches. 1. Push Model - In this content of the file is first read into byte array and then it is pushed/send from client to Server. But with this model problem
2
2643
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 the entire file is transfered. The problem that I have right now is that I can only read the data to the buffer one time and one time only. So for instance if my file is 1 MG. I can only read the first 256 char which is the size of my buffer.
0
1141
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 files, it did not return any error that i can see but then the sent files are just not stored on the server? They are just lost. And i tried so many ways but still hopeless. can you please help me out. Here are my code: FROM WINCE DEVICE: ...
1
1321
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. When i am looked in the task manger i saw the my application tacks about 500 Memory i try caple of things with no success Thanks in advance to the helpers
7
1824
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 = IPAddress.Parse("127.0.0.1"); TcpListener tcp = new TcpListener(ip, 1234);
0
8319
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8739
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6175
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2739
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 we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.