Contributions
Re: Using the System.Messaging.MessageQueue Object in C#Script
Thank you for the reply Helen. My preference is to use the MSMQ scripting API but I was having no luck with the c#script code. Here is my current attempt. var msmqInfo; var qname = ".\\private$\\TestQueue" msmqInfo = Sys["Messaging.MessageQueue"]; //set path for messaging object msmqInfo["Path"](qname); Testcomplete complains that the variable object 'msmqInfo' is undefined. Any help would be appreciated.1.4KViews0likes0CommentsUsing the System.Messaging.MessageQueue Object in C#Script
Hello, Below is an example of C# that will read a private MSMQ queue System.Messaging.MessageQueue queue = new System.Messaging.MessageQueue(".\\Private$\\MyPrivateQueue"); queue.Send("Hello world"); System.Messaging.Message msg = queue.Receive(); msg.Formatter = new System.Messaging.XmlMessageFormatter( new string[] {"System.String"}); Console.WriteLine(msg.Body); How do you code this in C#Script? Thanks19KViews0likes3Comments