MessageQueue.Delete メソッド
アセンブリ: System.Messaging (system.messaging.dll 内)



path パラメータの構文は、キューの種類によって異なります。
構文の詳細については、Path プロパティのトピックを参照してください。
FormatName または Label を使用してキューのパスを記述することもできます。
このメソッドが各種のワークグループ モードで使用できるかどうかを次の表に示します。

メッセージ キューのキューが存在する場合に、そのメッセージ キューのキューを削除するコード例を次に示します。
Imports System Imports System.Messaging Public Class MyNewQueue ' Provides an entry point into the application. ' ' This example verifies existence and attempts to ' delete a queue. Public Shared Sub Main() ' Determine whether the queue exists. If MessageQueue.Exists(".\myQueue") Then Try ' Delete the queue. MessageQueue.Delete(".\myQueue") Catch e As MessageQueueException If e.MessageQueueErrorCode = _ MessageQueueErrorCode.AccessDenied Then Console.WriteLine("Access is denied. " _ + "Queue might be a system queue.") End If ' Handle other sources of exceptions as necessary. End Try End If Return End Sub 'Main End Class 'MyNewQueue
using System; using System.Messaging; namespace MyProject { /// <summary> /// Provides a container class for the example. /// </summary> public class MyNewQueue { //************************************************** // Provides an entry point into the application. // // This example verifies existence and attempts to // delete a queue. //************************************************** public static void Main() { // Determine whether the queue exists. if (MessageQueue.Exists(".\\myQueue")) { try { // Delete the queue. MessageQueue.Delete(".\\myQueue"); } catch(MessageQueueException e) { if(e.MessageQueueErrorCode == MessageQueueErrorCode.AccessDenied) { Console.WriteLine("Access is denied. " + "Queue might be a system queue."); } // Handle other sources of MessageQueueException. } } return; } } }
#using <system.dll> #using <system.messaging.dll> using namespace System; using namespace System::Messaging; int main() { // Determine whether the queue exists. if ( MessageQueue::Exists( ".\\myQueue" ) ) { try { // Delete the queue. MessageQueue::Delete( ".\\myQueue" ); } catch ( MessageQueueException^ e ) { if ( e->MessageQueueErrorCode == MessageQueueErrorCode::AccessDenied ) { Console::WriteLine( "Access is denied. Queue might be a system queue." ); } // Handle other sources of MessageQueueException. } } return 0; }
package MyProject; import System.*; import System.Messaging.*; /// <summary> /// Provides a container class for the example. /// </summary> public class MyNewQueue { //************************************************** // Provides an entry point into the application. // // This example verifies existence and attempts to // delete a queue. //************************************************** public static void main(String[] args) { // Determine whether the queue exists. if (MessageQueue.Exists(".\\myQueue")) { try { // Delete the queue. MessageQueue.Delete(".\\myQueue"); } catch (MessageQueueException e) { if (e.get_MessageQueueErrorCode(). Equals(MessageQueueErrorCode.AccessDenied)) { Console.WriteLine("Access is denied. " + "Queue might be a system queue."); } // Handle other sources of MessageQueueException. } } return; } //main } //MyNewQueue


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からMessageQueue.Delete メソッドを検索する場合は、下記のリンクをクリックしてください。

- MessageQueue.Delete メソッドのページへのリンク