home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 9 / IOPROG_9.ISO / contrib / iis4 / iis4_07.cab / ExpressDelivery_VBScript.asp < prev    next >
Encoding:
Text File  |  1997-09-04  |  2.4 KB  |  81 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <%  Option Explicit     %>
  3.  
  4. <HTML>
  5.     <HEAD>
  6.         <TITLE>Simple MSMQ Transmission (Using Express Delivery)</TITLE>
  7.     </HEAD>
  8.  
  9.     <BODY bgcolor="white" topmargin="10" leftmargin="10">
  10.  
  11.         
  12.         <!-- Display Header -->
  13.  
  14.         <font size="4" face="Arial, Helvetica">
  15.         <b>Simple MSMQ Transmission (Using Express Delivery)</b></font><br>
  16.       
  17.         <hr size="1" color="#000000">
  18.  
  19.         This sample demonstrates how to send a simple asynchronous message using 
  20.         the Microsoft Message Queueing Server (MSMQ).  MSMQ is one of the components
  21.         that comes with the Windows NT 4.0 Option Pack.
  22.   
  23.         <p> This sample will open the "IIS_SDK_EXAMPLE" queue located on the local
  24.         machine, and transmit a simple message to it.  Because we have not specified
  25.         otherwise, the message will be sent using the default express delivery method.
  26.         This means that, in the event of a crash on the MSMQ machine, the message
  27.         will be lost.  The advantage of express delivery, however, is that messages
  28.         can be sent very quickly.
  29.  
  30.         <p> For this example to work, MSMQ must be first be installed on the host machine.
  31.         Using the MSMQ Explorer, a queue named "IIS_SDK_EXAMPLE" should then be created.
  32.         After the example is run, return to the MSMQ Explorer and select "Refresh" from
  33.         the "View" menu.  The recently sent message will then appear within the "IIS_SDK_EXAMPLE"
  34.         queue.
  35.  
  36.         <%
  37.             Dim QueueInfo
  38.             Dim Queue
  39.             Dim Msg
  40.  
  41.  
  42.             ' Create MSMQQueueInfo Component to Open
  43.             ' MessageQueue
  44.  
  45.             Set QueueInfo = Server.CreateObject("MSMQ.MSMQQueueInfo")
  46.  
  47.  
  48.             ' Open Queue.  The queue could be physically located
  49.             ' on any machine.  The period in the line below
  50.             ' indicates that the queue is located on the local machine.
  51.  
  52.             QueueInfo.pathname = ".\IIS_SDK_EXAMPLE"
  53.             Set Queue = QueueInfo.Open(2, 0)
  54.  
  55.  
  56.             ' Create Message Component for Queue
  57.             
  58.             Set Msg = Server.CreateObject("MSMQ.MSMQMessage")
  59.  
  60.  
  61.             ' Construct Message.  Note than anything can be passed
  62.             ' into both the body and label.  The developer is
  63.             ' responsible for marshalling all arguments.
  64.             
  65.             Msg.body = "This is the message body"
  66.             Msg.Label = "This is the message label"
  67.  
  68.  
  69.             ' Send Message
  70.             
  71.             Msg.Send Queue
  72.  
  73.  
  74.             ' Close Queue
  75.             
  76.             Queue.Close
  77.         %>
  78.  
  79.     </BODY>
  80. </HTML>
  81.