MessageQueueException 클래스

정의

Microsoft Message Queuing 내부 오류가 발생한 경우에 throw되는 예외입니다.

public ref class MessageQueueException : System::Runtime::InteropServices::ExternalException
[System.Serializable]
public class MessageQueueException : System.Runtime.InteropServices.ExternalException
[<System.Serializable>]
type MessageQueueException = class
    inherit ExternalException
    interface ISerializable
Public Class MessageQueueException
Inherits ExternalException
상속
특성
구현

예제

#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;
}
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;
        }
    }
}
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

End Class

설명

관련 된 예외는 MessageQueueException 클래스 내부 오류 코드를 사용 하 여 처리 해야 하는 메시지 큐에 의해 생성 됩니다.

모든 예외는 오류 코드 및 오류 원인을 설명 하는 텍스트 문자열로 구성 됩니다. 참조 된 MessageQueueErrorCode 이러한 오류 코드 및 해당 설명의 목록에 대 한 클래스입니다.

MessageQueue에서 sharedModeDenyReceive 매개 변수가 true로 설정된 큐를 여는 경우 이후에 MessageQueue에서 이 큐에서 읽으려 할 때마다 공유 위반으로 인해 MessageQueueException 예외가 생성됩니다. 다른 MessageQueue에서 큐에 이미 비독점적으로 액세스하고 있는 동안 MessageQueue에서 단독 모드로 큐에 액세스를 시도하는 경우에도 동일한 예외가 throw됩니다.

경고 태그는 지원 되지 않습니다!
MessageQueueTransaction 는 스레딩 아파트 인식입니다. 에 주 스레드의 상태를 설정 하는 Visual Basic STA이므로 적용 해야 합니다는 MTAThreadAttributeMain 서브루틴입니다. 그렇지 않으면 다른 스레드를 사용하여 트랜잭션 메시지를 전달할 때 MessageQueueException 예외가 throw됩니다.

생성자

MessageQueueException(SerializationInfo, StreamingContext)

serialize된 데이터를 사용하여 MessageQueueException 클래스의 새 인스턴스를 초기화합니다.

속성

Data

예외에 대한 사용자 정의 정보를 추가로 제공하는 키/값 쌍 컬렉션을 가져옵니다.

(다음에서 상속됨 Exception)
ErrorCode

오류의 HRESULT를 가져옵니다.

(다음에서 상속됨 ExternalException)
HelpLink

이 예외와 연결된 도움말 파일에 대한 링크를 가져오거나 설정합니다.

(다음에서 상속됨 Exception)
HResult

특정 예외에 할당된 코드화된 숫자 값인 HRESULT를 가져오거나 설정합니다.

(다음에서 상속됨 Exception)
InnerException

현재 예외를 발생시킨 Exception 인스턴스를 가져옵니다.

(다음에서 상속됨 Exception)
Message

메시지 큐 오류를 설명하는 값을 가져옵니다.

MessageQueueErrorCode

이 예외와 관련된 오류 코드를 표시하는 값을 가져옵니다.

Source

오류를 발생시키는 애플리케이션 또는 개체의 이름을 가져오거나 설정합니다.

(다음에서 상속됨 Exception)
StackTrace

호출 스택의 직접 실행 프레임 문자열 표현을 가져옵니다.

(다음에서 상속됨 Exception)
TargetSite

현재 예외를 throw하는 메서드를 가져옵니다.

(다음에서 상속됨 Exception)

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetBaseException()

파생 클래스에서 재정의된 경우 하나 이상의 후속 예외의 근본 원인이 되는 Exception 을 반환합니다.

(다음에서 상속됨 Exception)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetObjectData(SerializationInfo, StreamingContext)

MessageQueueException을 serialize하는 데 필요한 데이터로 serialization 정보 개체를 채웁니다.

GetType()

현재 인스턴스의 런타임 형식을 가져옵니다.

(다음에서 상속됨 Exception)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

오류의 HRESULT가 들어 있는 문자열을 반환합니다.

(다음에서 상속됨 ExternalException)

이벤트

SerializeObjectState
사용되지 않음.

예외에 대한 serialize된 데이터가 들어 있는 예외 상태 개체가 만들어지도록 예외가 serialize될 때 발생합니다.

(다음에서 상속됨 Exception)

적용 대상

추가 정보