Microsoft KB Archive/173339: Difference between revisions

From BetaArchive Wiki
m (Text replacement - "<" to "<")
m (Text replacement - """ to """)
 
(One intermediate revision by the same user not shown)
Line 58: Line 58:


</div>
</div>
<pre class="codesample">  <HTML&gt;
<pre class="codesample">  <HTML>
   <BODY&gt;
   <BODY>
   Create an MSMQ queue and send a test message
   Create an MSMQ queue and send a test message
   <%
   <%
       set iq = Server.CreateObject (&quot;MSMQ.MSMQQueueInfo&quot;)
       set iq = Server.CreateObject ("MSMQ.MSMQQueueInfo")


       iq.PathName = &quot;.\ASPQueue&quot;
       iq.PathName = ".\ASPQueue"
       iq.Create
       iq.Create
       set myq = iq.Open ( 2, 0 )
       set myq = iq.Open ( 2, 0 )
       If myq.IsOpen Then
       If myq.IsOpen Then
               Set msgOut = Server.CreateObject(&quot;MSMQ.MSMQMessage&quot;)
               Set msgOut = Server.CreateObject("MSMQ.MSMQMessage")


             msgOut.Priority = 4
             msgOut.Priority = 4
             msgOut.Body = &quot;This is a test message&quot;
             msgOut.Body = "This is a test message"
             msgOut.Label = &quot;Test Message&quot;
             msgOut.Label = "Test Message"
             msgOut.Send myq
             msgOut.Send myq
         End If
         End If
         myq.Close
         myq.Close
   %&gt;
   %>
   </BODY&gt;
   </BODY>
   </HTML&gt;
   </HTML>
                 </pre>
                 </pre>



Latest revision as of 11:06, 21 July 2020

Knowledge Base


Article ID: 173339

Article Last Modified on 4/28/2005



APPLIES TO

  • Microsoft Message Queue Server 1.0



This article was previously published under Q173339

SUMMARY

This article describes how to create an Microsoft Message Queue Server (MSMQ) 1.0 queue and send a test message to the queue using an Active Server Pages (ASP) script that uses VBScript.

MORE INFORMATION

Create the following file and save it as a text file with an .asp extension, (for example mq.asp), in your InetPub\Scripts folder, and then open your Web browser and point to the following:

   <HTML>
   <BODY>
   Create an MSMQ queue and send a test message
   <%
      set iq = Server.CreateObject ("MSMQ.MSMQQueueInfo")

      iq.PathName = ".\ASPQueue"
      iq.Create
      set myq = iq.Open ( 2, 0 )
      If myq.IsOpen Then
              Set msgOut = Server.CreateObject("MSMQ.MSMQMessage")

            msgOut.Priority = 4
            msgOut.Body = "This is a test message"
            msgOut.Label = "Test Message"
            msgOut.Send myq
         End If
        myq.Close
   %>
   </BODY>
   </HTML>
                

REFERENCES

For additional information review the Tutorial in the ASPSamp folder that is installed by IIS/ASP setup. The tutorial contains documentation on how to use ActiveX objects from ASP.

MSMQ SDK Help; search on MSMQ ActiveX components.

(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Syed Yousuf, Microsoft Corporation


Additional query words: IIS

Keywords: kbhowto kbfaq KB173339