Creating a message Queue with C#

T

Tony Hamill

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.
 
W

Willy Denoyette [MVP]

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top