home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / QuickStart / howto / doc / mqctrl.aspx < prev    next >
Encoding:
Text File  |  2000-06-08  |  3.3 KB  |  75 lines

  1.  
  2. <!-- #include virtual="/quickstart/howto/include/header.inc" -->
  3.  
  4. <h4>How Do I...Control a message queue?</h4>
  5.  
  6. <div class="indent" style="width:660">
  7. <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">Message
  8. queuing makes it easy for application developers to communicate with application
  9. programs quickly and reliably by sending and receiving messages. Messaging
  10. provides you with guaranteed message delivery and a robust, fail-safe way to
  11. carry out many of your business processes.<br>
  12. <br>
  13. The MessageQueue component allows you to easily incorporate message-based
  14. communication into your applications. Using this component and its associated
  15. language features, you can send and receive messages, explore existing queues,
  16. create and delete queues, and perform a variety of other operations using a
  17. simple programming model.<br>
  18. <br>
  19. This sample illustrates how to change some properties of a message queue. It's a
  20. small console application that can be run from a command prompt. Run the sample
  21. without any command line arguments and it will print its full usage
  22. instructions.</O:P>
  23.  <O:P>
  24. </O:P>
  25. </span></p>
  26. <p class="Text"><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma; mso-bidi-font-size: 10.0pt">For
  27. example, if you want change a queue's label run: </O:P>
  28. </span></p>
  29. <p class="MsoNormal" style="MARGIN-LEFT: 0.5in"><span style="COLOR: blue; FONT-FAMILY: Courier New; mso-bidi-font-size: 12.0pt"><font size="2">>
  30. MQCtrl.exe MyQueue l "New Label"</font></span><span style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 12.0pt"><O:P>
  31.  </O:P>
  32. <O:P>
  33. </O:P>
  34. </span></p>
  35. <p><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma; mso-bidi-font-size: 12.0pt">In
  36. its simplest form, changing a property of a message queue involves:</span></p>
  37. <p><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma; mso-bidi-font-size: 12.0pt">1.
  38. Instantiating a MessageQueue component and pointing it to an existing queue:</span></p>
  39. <blockquote>
  40.   <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Courier New" color="#0000ff" size="2">MessageQueue mq = new
  41.   MessageQueue(mqPath);</font></p>
  42. </blockquote>
  43. <p><span style="FONT-SIZE: 8pt; FONT-FAMILY: Tahoma; mso-bidi-font-size: 12.0pt">2.
  44. Setting the property to a new value:<O:P>
  45. </span></p>
  46. <blockquote>
  47.   <p><font face="Courier New" color="#0000ff" size="2">mq.Label = "New
  48.   Label";</font></p>
  49. </blockquote>
  50. <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">Have
  51. a good time MessageQueue'ing!</font></p>
  52.  
  53. </div>
  54.  
  55. <h4>Example</h4>
  56.  
  57. <p>
  58. <div class="indent">
  59. <a target="_blank" href="/quickstart/howto/samples/Services/MessageQueue/MQCtrl">
  60. <img style="border-color:black" border=1 src="/quickstart/images/genicon.gif"><br>
  61. </a>
  62. <div class="caption">MQCtrl.exe</div><br>
  63. [<a target="_blank" href="/quickstart/howto/samples/Services/MessageQueue/MQCtrl">View Sample</a>] | 
  64. [<a target="_blank" href="/quickstart/util/srcview.aspx?path=/quickstart/howto/samples/Services/MessageQueue/MQCtrl/MQCtrl.src">View Source</a>]<p>
  65. </div>
  66.  
  67. <h4>Source Code</h4>
  68.  
  69. <div class="code">
  70. <xmp>
  71. <!-- #include virtual="/quickstart/howto/samples/Services/MessageQueue/MQCtrl/MQCtrl.cs" -->
  72. </xmp>
  73. </div>
  74.  
  75. <!-- #include virtual="/quickstart/howto/include/footer.inc" -->