MessageQueue myMQ;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
myMQ = new MessageQueue(@".\Private$\InteropQueue");
if (myMQ != null && !MessageQueue.Exists(myMQ.Path))
{
myMQ = MessageQueue.Create(@".\Private$\InteropQueue");
}
System.Messaging.Message msg = new System.Messaging.Message();
msg.Body = "Test";
myMQ.Send(msg);
}
MessageQueue mq;
System.Messaging.Message msg;
private void button2_Click(object sender, EventArgs e)
{
mq = new MessageQueue(@".\Private$\InteropQueue");
Type[] types = new Type[1];
types[0] = typeof(String);
mq.Formatter = new XmlMessageFormatter(types);
try
{
// Call receive on queue
msg = mq.Receive(new TimeSpan(0, 0, 100)); // 5 is wait time in seconds
// Assign to variable
MessageBox.Show(msg.Body.ToString());
}
catch( Exception ex)
{
MessageBox.Show(ex.Message);
}
Microsoft Hosted General Download from Microsoft Failing with 500.30
Asp.Net Core error - Microsoft Q&A
-
I was asked to post this question here as well...I'm following a Microsoft
article
(https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view...
6 months ago
No comments:
Post a Comment