473,473 Members | 1,511 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Creating a message Queue with C#

Hi,
can somebody provide me with the correct syntax for creating a message queue in C#.

I have

private void button1_Click(object sender, System.EventArgs e) {

// C#

try{

string QueueName = @"DIRECT=OS:81.98.63.102\PRIVATE$\testq";

MessageQueue myQueue = new MessageQueue();

myQueue.Path=QueueName;
if ( myQueue.Transactional ) {

myQueue.Send("My Message Data.", new MessageQueueTransaction());

}

}

catch (Exception f) {

label1.Text=f.Message;

}

}

but get "Invalid Queue name"

if I put FormatName in front of the DIRECT it fails with "The specified frmat name does not support the requested operation. For example a direct queue format name cannot be deleted". I am finding it very difficult to get reliable information on this.

Any help greatly appreciated.


Nov 15 '05 #1
2 18767


"Tony Hamill" <an************@ntlworld.com> wrote in message news:Wt*********************@newsfep2-win.server.ntli.net...
Hi,
can somebody provide me with the correct syntax for creating a message queue in C#.

I have

private void button1_Click(object sender, System.EventArgs e) {

// C#

try{

string QueueName = @"DIRECT=OS:81.98.63.102\PRIVATE$\testq";

MessageQueue myQueue = new MessageQueue();

myQueue.Path=QueueName;
if ( myQueue.Transactional ) {

myQueue.Send("My Message Data.", new MessageQueueTransaction());

}

}

catch (Exception f) {

label1.Text=f.Message;

}

}

but get "Invalid Queue name"

if I put FormatName in front of the DIRECT it fails with "The specified frmat name does not support the requested operation. For example a direct queue format name cannot be deleted". I am finding it very difficult to get reliable information on this.

Any help greatly appreciated.

Please use TCP if specifying an IP address in Dot notation.
Formatname:TCP:www.xxx.yyy.zzz.....

or better use the machine name

.Formatname:OS:<MachineName>
Nov 15 '05 #2


"Tony Hamill" <an************@ntlworld.com> wrote in message news:Wt*********************@newsfep2-win.server.ntli.net...
Hi,
can somebody provide me with the correct syntax for creating a message queue in C#.

I have

private void button1_Click(object sender, System.EventArgs e) {

// C#

try{

string QueueName = @"DIRECT=OS:81.98.63.102\PRIVATE$\testq";

MessageQueue myQueue = new MessageQueue();

myQueue.Path=QueueName;
if ( myQueue.Transactional ) {

myQueue.Send("My Message Data.", new MessageQueueTransaction());

}

}

catch (Exception f) {

label1.Text=f.Message;

}

}

but get "Invalid Queue name"

if I put FormatName in front of the DIRECT it fails with "The specified frmat name does not support the requested operation. For example a direct queue format name cannot be deleted". I am finding it very difficult to get reliable information on this.

Any help greatly appreciated.

Please use TCP if specifying an IP address in Dot notation.
Formatname:TCP:www.xxx.yyy.zzz.....

or better use the machine name

.Formatname:OS:<MachineName>
Nov 15 '05 #3

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

Similar topics

7
by: mike | last post by:
Hi, I am having difficulty in creating a thread using pthread_create. It seems that pthread_create does not execute 'program', and returns -1; I have checked the API but I am not sure why this...
4
by: Tingo | last post by:
Hi all, Is it possible to create a message queue with a specific ID? I want to do this because I'm trying to write a piece of software which restores communicating processes (which communicate...
0
by: Tony Hamill | last post by:
Hi, can somebody provide me with the correct syntax for creating a message queue in C#. I have private void button1_Click(object sender, System.EventArgs e) { // C# try{
8
by: Brian Keating EI9FXB | last post by:
Would I be correct in saying that the only way to get a user message into a Windows form would be to use P/Invoke with Message? Of is there some part of the .NET API that I am totally un aware...
6
by: les | last post by:
Here's a class which uses 2.0 generics to implement an inter-thread message queue in C#. Any number of threads can post and read from the queue simultaneously, and the message object can be any...
13
by: LordHog | last post by:
Hello all, I have a little application that needs to poll a device (CAN communications) every 10 to 15 ms otherwise the hardware buffer might overflow when there are message burst on the bus. I...
0
by: aadsaca | last post by:
hi there, I just want to know if it is possible to create Message Queue on other Computer? if yes, how to do it? tnx,
2
by: bernd | last post by:
Hi netties, posted this in a different group already, which seems to be inappropriate. I create a message queue with msgget(), sent a 5-byte message to it with msgsnd() and try to receive the...
2
by: slizorn | last post by:
hi guys, i need to make a tree traversal algorithm that would help me search the tree.. creating a method to search a tree to find the position of node and to return its pointer value basically i...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
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
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
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
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
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 ...

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.