home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 9 / IOPROG_9.ISO / contrib / iis4 / iis4_07.cab / EncryptedDelivery_VBScript.asp < prev    next >
Encoding:
Text File  |  1997-09-04  |  2.6 KB  |  84 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> This sample will open the "IIS_SDK_EXAMPLE" queue located on the local
  24.         machine, and transmit a simple encrypted message to it.  When sending an encrypted
  25.         message, the source Queue manager encrypts the body of the message and the target 
  26.         queue manager decrypts the message body.  A developer does not have to write
  27.         any custom encryption routines.  By selecting the "Columns" option within
  28.         the "View" menu of the MSMQ Explorer application, it is possible to display
  29.         the encryption status and method of each message within a queue.
  30.  
  31.         <p> For this example to work, MSMQ must be first be installed on the host machine.
  32.         Using the MSMQ Explorer, a queue named "IIS_SDK_EXAMPLE" should then be created.
  33.         After the example is run, return to the MSMQ Explorer and select "Refresh" from
  34.         the "View" menu.  The recently sent message will then appear within the "IIS_SDK_EXAMPLE"
  35.         queue.
  36.  
  37.         <%
  38.             Dim QueueInfo
  39.             Dim Queue
  40.             Dim Msg
  41.  
  42.  
  43.             ' Create MSMQQueueInfo Component to Open
  44.             ' MessageQueue
  45.  
  46.             Set QueueInfo = Server.CreateObject("MSMQ.MSMQQueueInfo")
  47.  
  48.  
  49.             ' Open Queue.  The queue could be physically located
  50.             ' on any machine.  The period in the line below indicates
  51.             ' that the queue is located on the local machine.
  52.  
  53.             QueueInfo.pathname = ".\IIS_SDK_EXAMPLE"
  54.             Set Queue = QueueInfo.Open(2, 0)
  55.  
  56.  
  57.             ' Create Message Component for Queue
  58.             
  59.             Set Msg = Server.CreateObject("MSMQ.MSMQMessage")
  60.  
  61.  
  62.             ' Construct Message.  Note that the PrivLevel of
  63.             ' the message has been set to require encryption.
  64.             ' This will ensure that the message remains encrypted
  65.             ' until an authorized receiver reads it.
  66.  
  67.             Msg.PrivLevel = 1
  68.             Msg.body = "This is the message body"
  69.             Msg.Label = "This is the message label"
  70.  
  71.  
  72.             ' Send Message
  73.             
  74.             Msg.Send(Queue)
  75.  
  76.  
  77.             ' Close Queue
  78.             
  79.             Queue.Close
  80.         %>
  81.  
  82.     </BODY>
  83. </HTML>
  84.