home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 September / CHIPCD_9_99.iso / software / uaktualnienia / OptionPackPL / iis4_07.cab / EncryptedDelivery_JScript.asp < prev    next >
Text File  |  1998-04-27  |  2KB  |  72 lines

  1. <%@ LANGUAGE = JScript %>
  2.  
  3. <HTML>
  4.     <HEAD>
  5.         <TITLE>Encrypted MSMQ Transmission</TITLE>
  6.     </HEAD>
  7.  
  8.     <BODY bgcolor="white" topmargin="10" leftmargin="10">
  9.  
  10.         
  11.         <!-- Display Header -->
  12.  
  13.         <font size="4" face="Arial, Helvetica">
  14.         <b>Encrypted MSMQ Transmission</b></font><br>
  15.       
  16.         <hr size="1" color="#000000">
  17.  
  18.         This sample demonstrates how to send an encrypted asynchronous message using 
  19.         the Microsoft Message Queueing Server (MSMQ).  MSMQ is one of the components
  20.         that comes with the Windows NT 4.0 Option Pack.
  21.   
  22.         <p> For this example to work, MSMQ must be first be installed on the host machine.
  23.         Using the MSMQ Explorer, a queue named "IIS_SDK_EXAMPLE" should then be created.
  24.         After the example is run, return to the MSMQ Explorer and select "Refresh" from
  25.         the "View" menu.  The recently sent message will then appear within the "IIS_SDK_EXAMPLE"
  26.         queue.
  27.  
  28.         <%
  29.             // Create MSMQQueueInfo Component to Open
  30.             // MessageQueue
  31.  
  32.             QueueInfo = Server.CreateObject("MSMQ.MSMQQueueInfo");
  33.  
  34.  
  35.             // Open Queue.  The queue could be physically located
  36.             // on any machine.  The period in the line below indicate
  37.             // that the queue is located on the local machine.  Note
  38.             // that because JScript is being used as the scripting
  39.             // language, and extra backslash must be inserted as
  40.             // an escape character.
  41.  
  42.             QueueInfo.pathname = ".\\IIS_SDK_EXAMPLE";
  43.             Queue = QueueInfo.Open(2, 0);
  44.  
  45.  
  46.             // Create Message Component for Queue
  47.             
  48.             Msg = Server.CreateObject("MSMQ.MSMQMessage");
  49.  
  50.  
  51.             // Construct Message.  Note that the PrivLevel of
  52.             // the message has been set to require encryption.
  53.             // This will ensure that the message remains encrypted
  54.             // until an authorized receiver reads it.
  55.  
  56.             Msg.body = "This is the message body";
  57.             Msg.Label = "This is the message label";
  58.             Msg.PrivLevel = 1;
  59.  
  60.             // Send Message
  61.             
  62.             Msg.Send(Queue);
  63.  
  64.  
  65.             // Close Queue
  66.             
  67.             Queue.Close();
  68.         %>
  69.  
  70.     </BODY>
  71. </HTML>
  72.