home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / EncryptedDelivery_VBScript.asp < prev    next >
Text File  |  1997-10-25  |  2KB  |  76 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <%  Option Explicit     %>
  3.  
  4. <HTML>
  5.     <HEAD>
  6.         <TITLE>Encrypted MSMQ Transmission</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>Encrypted MSMQ Transmission</b></font><br>
  16.       
  17.         <hr size="1" color="#000000">
  18.  
  19.         This sample demonstrates how to send an encrypted 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 indicates
  43.             ' 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 that the PrivLevel of
  55.             ' the message has been set to require encryption.
  56.             ' This will ensure that the message remains encrypted
  57.             ' until an authorized receiver reads it.
  58.  
  59.             Msg.PrivLevel = 1
  60.             Msg.body = "This is the message body"
  61.             Msg.Label = "This is the message label"
  62.  
  63.  
  64.             ' Send Message
  65.             
  66.             Msg.Send(Queue)
  67.  
  68.  
  69.             ' Close Queue
  70.             
  71.             Queue.Close
  72.         %>
  73.  
  74.     </BODY>
  75. </HTML>
  76.