home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / ExpressDelivery_VBScript.asp < prev    next >
Text File  |  1997-10-25  |  2KB  |  74 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> For this example to work, MSMQ must be first be installed on the host machine.
  24.         Using the MSMQ Explorer, a queue named "IIS_SDK_EXAMPLE" should then be created.
  25.         After the example is run, return to the MSMQ Explorer and select "Refresh" from
  26.         the "View" menu.  The recently sent message will then appear within the "IIS_SDK_EXAMPLE"
  27.         queue.
  28.  
  29.         <%
  30.             Dim QueueInfo
  31.             Dim Queue
  32.             Dim Msg
  33.  
  34.  
  35.             ' Create MSMQQueueInfo Component to Open
  36.             ' MessageQueue
  37.  
  38.             Set QueueInfo = Server.CreateObject("MSMQ.MSMQQueueInfo")
  39.  
  40.  
  41.             ' Open Queue.  The queue could be physically located
  42.             ' on any machine.  The period in the line below
  43.             ' indicates that the queue is located on the local machine.
  44.  
  45.             QueueInfo.pathname = ".\IIS_SDK_EXAMPLE"
  46.             Set Queue = QueueInfo.Open(2, 0)
  47.  
  48.  
  49.             ' Create Message Component for Queue
  50.             
  51.             Set Msg = Server.CreateObject("MSMQ.MSMQMessage")
  52.  
  53.  
  54.             ' Construct Message.  Note than anything can be passed
  55.             ' into both the body and label.  The developer is
  56.             ' responsible for marshalling all arguments.
  57.             
  58.             Msg.body = "This is the message body"
  59.             Msg.Label = "This is the message label"
  60.  
  61.  
  62.             ' Send Message
  63.             
  64.             Msg.Send Queue
  65.  
  66.  
  67.             ' Close Queue
  68.             
  69.             Queue.Close
  70.         %>
  71.  
  72.     </BODY>
  73. </HTML>
  74.