MessageQueue.Delete メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > MessageQueue.Delete メソッドの意味・解説 

MessageQueue.Delete メソッド

メッセージ キュー サーバーキュー削除します

名前空間: System.Messaging
アセンブリ: System.Messaging (system.messaging.dll 内)
構文構文

例外例外
例外種類条件

ArgumentException

path パラメータnull 参照 (Visual Basic では Nothing) または空の文字列 ("") です。

MessageQueueException

path パラメータ構文無効です。

または

メッセージ キューメソッドアクセスしたときにエラー発生しました

解説解説
使用例使用例

メッセージ キューキュー存在する場合に、そのメッセージ キューキュー削除するコード例次に示します

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 
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からMessageQueue.Delete メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からMessageQueue.Delete メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からMessageQueue.Delete メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「MessageQueue.Delete メソッド」の関連用語

MessageQueue.Delete メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



MessageQueue.Delete メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS