Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Sat, 4 Feb 2006 23:56:11 -0800,    group: microsoft.public.dotnet.myservices        back       


cannot post to MSMQ from dotnet code   
I am not able to post a simple message locally to my local MSMQ through this 
code although I can post to the same queue using some demo code.

My code is



using System;
using System.Collections.Generic;
using System.Xml;
using System.IO;
using System.Text;
using System.Reflection;
using System.Messaging;

namespace WindowsApplication1
{
    static class test
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            

            string oobject;
            Message mymessage = new Message();
            MessageQueue myMSMQueue = new MessageQueue();
            MessageQueueTransaction myquetrans = new 
MessageQueueTransaction();
            ActiveXMessageFormatter xmlmessageformat = new 
ActiveXMessageFormatter();
            myMSMQueue.Path = (@".\private$\incomingqueue");


            oobject = "message sent";
            mymessage.Label = "testx";
            mymessage.Body = oobject;
            try
            {
                myMSMQueue.Send(oobject);
            }
            catch (MessageQueueException ex)
            {
                Console.WriteLine("message " + ex.Message);
                Console.WriteLine("message " + ex.Source);
                Console.WriteLine("message " + ex.InnerException.Message);
            }

            myMSMQueue.Close();

                    }
    }
}
date: Sat, 4 Feb 2006 23:56:11 -0800   author:   Jack

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us