%@ LANGUAGE = VBScript %> <% Option Explicit %>
This sample demonstrates how to send a simple asynchronous message using the Microsoft Message Queueing Server (MSMQ). MSMQ is one of the components that comes with the Windows NT 4.0 Option Pack.
For this example to work, MSMQ must be first be installed on the host machine. Using the MSMQ Explorer, a queue named "IIS_SDK_EXAMPLE" should then be created. After the example is run, return to the MSMQ Explorer and select "Refresh" from the "View" menu. The recently sent message will then appear within the "IIS_SDK_EXAMPLE" queue. <% Dim QueueInfo Dim Queue Dim Msg 'Create MSMQQueueInfo component to open 'MessageQueue. Set QueueInfo = Server.CreateObject("MSMQ.MSMQQueueInfo") 'Open queue. The queue can be physically 'located on any machine. The period in the line 'below indicates that the queue is located on 'the local machine. QueueInfo.pathname = ".\IIS_SDK_EXAMPLE" Set Queue = QueueInfo.Open(2, 0) 'Create message component for queue. Set Msg = Server.CreateObject("MSMQ.MSMQMessage") 'Construct message. Note than anything can be 'passed into both the body and label. The 'developer is responsible for marshaling all 'arguments. Msg.body = "This is the message body" Msg.Label = "This is the message label" 'Send message. Msg.Send Queue 'Close queue. Queue.Close %>