Message Message Message Message Class

定義

提供定義訊息佇列訊息所需屬性的存取。Provides access to the properties needed to define a Message Queuing message.

public ref class Message : System::ComponentModel::Component
public class Message : System.ComponentModel.Component
type Message = class
    inherit Component
Public Class Message
Inherits Component
繼承

範例

下列程式碼範例示範如何使用來BinaryMessageFormatter格式化訊息內文。The following code example demonstrates formatting a message body using BinaryMessageFormatter.

#using <system.dll>
#using <system.messaging.dll>
#using <system.drawing.dll>

using namespace System;
using namespace System::Messaging;
using namespace System::Drawing;
using namespace System::IO;

/// <summary>
/// Provides a container class for the example.
/// </summary>
ref class MyNewQueue
{
public:

   //*************************************************
   // Creates a new queue.
   //*************************************************
   static void CreateQueue( String^ queuePath )
   {
      try
      {
         if (  !MessageQueue::Exists( queuePath ) )
         {
            MessageQueue::Create( queuePath );
         }
         else
         {
            Console::WriteLine(  "{0} already exists.", queuePath );
         }
      }
      catch ( MessageQueueException^ e ) 
      {
         Console::WriteLine( e->Message );
      }

   }


   //*************************************************
   // Sends an image to a queue, using the BinaryMessageFormatter.
   //*************************************************
   void SendMessage()
   {
      try
      {
         
         // Create a new bitmap.
         // The file must be in the \bin\debug or \bin\retail folder, or
         // you must give a full path to its location.
         Image^ myImage = Bitmap::FromFile( "SentImage::bmp" );
         
         // Connect to a queue on the local computer.
         MessageQueue^ myQueue = gcnew MessageQueue( ".\\myQueue" );
         Message^ myMessage = gcnew Message( myImage,gcnew BinaryMessageFormatter );
         
         // Send the image to the queue.
         myQueue->Send( myMessage );
      }
      catch ( ArgumentException^ e ) 
      {
         Console::WriteLine( e->Message );
      }

      return;
   }


   //*************************************************
   // Receives a message containing an image.
   //*************************************************
   void ReceiveMessage()
   {
      try
      {
         
         // Connect to the a queue on the local computer.
         MessageQueue^ myQueue = gcnew MessageQueue( ".\\myQueue" );
         
         // Set the formatter to indicate body contains an Order.
         myQueue->Formatter = gcnew BinaryMessageFormatter;
         
         // Receive and format the message. 
         Message^ myMessage = myQueue->Receive();
         Bitmap^ myImage = static_cast<Bitmap^>(myMessage->Body);
         
         // This will be saved in the \bin\debug or \bin\retail folder.
         myImage->Save( "ReceivedImage::bmp", System::Drawing::Imaging::ImageFormat::Bmp );
      }
      catch ( MessageQueueException^ ) 
      {
         
         // Handle Message Queuing exceptions.
      }
      // Handle invalid serialization format.
      catch ( InvalidOperationException^ e ) 
      {
         Console::WriteLine( e->Message );
      }
      catch ( IOException^ e ) 
      {
         
         // Handle file access exceptions.
      }

      
      // Catch other exceptions as necessary.
      return;
   }

};


//*************************************************
// Provides an entry point into the application.
//         
// This example sends and receives a message from
// a queue.
//*************************************************
int main()
{
   
   // Create a new instance of the class.
   MyNewQueue^ myNewQueue = gcnew MyNewQueue;
   
   // Create a queue on the local computer.
   MyNewQueue::CreateQueue( ".\\myQueue" );
   
   // Send a message to a queue.
   myNewQueue->SendMessage();
   
   // Receive a message from a queue.
   myNewQueue->ReceiveMessage();
   return 0;
}

using System;
using System.Messaging;
using System.Drawing;
using System.IO;

namespace MyProject
{
	

	/// <summary>
	/// Provides a container class for the example.
	/// </summary>
	public class MyNewQueue
	{

		//**************************************************
		// Provides an entry point into the application.
		//		 
		// This example sends and receives a message from
		// a queue.
		//**************************************************

		public static void Main()
		{
			// Create a new instance of the class.
			MyNewQueue myNewQueue = new MyNewQueue();

			// Create a queue on the local computer.
			CreateQueue(".\\myQueue");
			
			// Send a message to a queue.
			myNewQueue.SendMessage();

			// Receive a message from a queue.
			myNewQueue.ReceiveMessage();

			return;
		}

		//**************************************************
		// Creates a new queue.
		//**************************************************

		public static void CreateQueue(string queuePath)
		{
			try	
			{
				if(!MessageQueue.Exists(queuePath))
				{
					MessageQueue.Create(queuePath);
				}
				else
				{
					Console.WriteLine(queuePath + " already exists.");
				}
			}
			catch (MessageQueueException e)
			{
				Console.WriteLine(e.Message);
			}
			
		}

		//**************************************************
		// Sends an image to a queue, using the BinaryMessageFormatter.
		//**************************************************
		
		public void SendMessage()
		{
			try{

				// Create a new bitmap.
				// The file must be in the \bin\debug or \bin\retail folder, or
				// you must give a full path to its location.
				Image myImage = Bitmap.FromFile("SentImage.bmp");

				// Connect to a queue on the local computer.
				MessageQueue myQueue = new MessageQueue(".\\myQueue");
				
				Message myMessage = new Message(myImage, new BinaryMessageFormatter());

				// Send the image to the queue.
				myQueue.Send(myMessage);
			}
			catch(ArgumentException e)
			{
				Console.WriteLine(e.Message);
			
			}

			return;
		}


		//**************************************************
		// Receives a message containing an image.
		//**************************************************
		
		public  void ReceiveMessage()
		{
						
			try
			{

				// Connect to the a queue on the local computer.
				MessageQueue myQueue = new MessageQueue(".\\myQueue");

				// Set the formatter to indicate body contains an Order.
				myQueue.Formatter = new BinaryMessageFormatter();

				// Receive and format the message. 
				System.Messaging.Message myMessage = myQueue.Receive(); 
				Bitmap myImage = (Bitmap)myMessage.Body;
				
				// This will be saved in the \bin\debug or \bin\retail folder.
				myImage.Save("ReceivedImage.bmp",System.Drawing.Imaging.ImageFormat.Bmp);
				
				
			}
			
			catch (MessageQueueException)
			{
				// Handle Message Queuing exceptions.
			}

			// Handle invalid serialization format.
			catch (InvalidOperationException e)
			{
				Console.WriteLine(e.Message);
			}

			catch (IOException e)
			{
				// Handle file access exceptions.
			}
			
			// Catch other exceptions as necessary.

			return;
		}
	}
}
Imports System.Messaging
Imports System.Drawing
Imports System.IO


Namespace MyProj
    _
   
   
   Public Class MyNewQueue
      
      
      '**************************************************
      ' Provides an entry point into the application.
      '		 
      ' This example sends and receives a message from
      ' a queue.
      '**************************************************
      Public Shared Sub Main()
         ' Create a new instance of the class.
         Dim myNewQueue As New MyNewQueue()
         
         ' Create a queue on the local computer.
         CreateQueue(".\myQueue")
         
         ' Send a message to a queue.
         myNewQueue.SendMessage()
         
         ' Receive a message from a queue.
         myNewQueue.ReceiveMessage()
         
         Return
      End Sub
      
      
      '**************************************************
      ' Creates a new queue.
      '**************************************************
      Public Shared Sub CreateQueue(queuePath As String)
         Try
            If Not MessageQueue.Exists(queuePath) Then
               MessageQueue.Create(queuePath)
            Else
               Console.WriteLine((queuePath + " already exists."))
            End If
         Catch e As MessageQueueException
            Console.WriteLine(e.Message)
         End Try
      End Sub
       
      
      '**************************************************
      ' Sends an image to a queue, using the BinaryMessageFormatter.
      '**************************************************
      Public Sub SendMessage()
         Try
            
            ' Create a new bitmap.
            ' The file must be in the \bin\debug or \bin\retail folder, or
            ' you must give a full path to its location.
            Dim myImage As Image = Bitmap.FromFile("SentImage.bmp")
            
            ' Connect to a queue on the local computer.
            Dim myQueue As New MessageQueue(".\myQueue")
            
            Dim myMessage As New Message(myImage, New BinaryMessageFormatter())
            
            ' Send the image to the queue.
            myQueue.Send(myMessage)
         Catch e As ArgumentException
            Console.WriteLine(e.Message)
         End Try 
         
         Return
      End Sub
      
      
      
      '**************************************************
      ' Receives a message containing an image.
      '**************************************************
      Public Sub ReceiveMessage()
         
         Try
            
            ' Connect to the a queue on the local computer.
            Dim myQueue As New MessageQueue(".\myQueue")
            
            ' Set the formatter to indicate body contains an Order.
            myQueue.Formatter = New BinaryMessageFormatter()
            
            ' Receive and format the message. 
            Dim myMessage As System.Messaging.Message = myQueue.Receive()
            Dim myImage As Bitmap = CType(myMessage.Body, Bitmap)
            
            ' This will be saved in the \bin\debug or \bin\retail folder.
            myImage.Save("ReceivedImage.bmp", System.Drawing.Imaging.ImageFormat.Bmp)
         
         
         
         'Catch
         ' Handle Message Queuing exceptions.
         
         ' Handle invalid serialization format.
         Catch e As InvalidOperationException
            Console.WriteLine(e.Message)
         
         Catch e As IOException
         End Try
         ' Handle file access exceptions.
         
         ' Catch other exceptions as necessary.
         Return
      End Sub
   End Class 'MyNewQueue
End Namespace 'MyProj

下列程式碼範例示範如何使用來XmlMessageFormatter格式化訊息內文。The following code example demonstrates formatting a message body using XmlMessageFormatter.

#using <system.dll>
#using <system.messaging.dll>
#using <system.drawing.dll>

using namespace System;
using namespace System::Messaging;
using namespace System::Drawing;
using namespace System::IO;
ref class Order
{
public:
   int orderId;
   DateTime orderTime;
};

ref class MyNewQueue
{
public:
   static void CreateQueue( String^ queuePath )
   {
      try
      {
         if (  !MessageQueue::Exists( queuePath ) )
         {
            MessageQueue::Create( queuePath );
         }
         else
         {
            Console::WriteLine(  "{0} already exists.", queuePath );
         }
      }
      catch ( MessageQueueException^ e ) 
      {
         Console::WriteLine( e->Message );
      }

   }

   void SendMessage()
   {
      try
      {
         // Create a new order and set values.
         Order^ sentOrder = gcnew Order;
         sentOrder->orderId = 3;
         sentOrder->orderTime = DateTime::Now;

         // Connect to a queue on the local computer.
         MessageQueue^ myQueue = gcnew MessageQueue( ".\\myQueue" );

         // Create the new order.
         Message^ myMessage = gcnew Message( sentOrder );

         // Send the order to the queue.
         myQueue->Send( myMessage );
      }
      catch ( ArgumentException^ e ) 
      {
         Console::WriteLine( e->Message );
      }

      return;
   }

   void ReceiveMessage()
   {
      // Connect to the a queue on the local computer.
      MessageQueue^ myQueue = gcnew MessageQueue( ".\\myQueue" );

      // Set the formatter to indicate body contains an Order.
      array<Type^>^p = gcnew array<Type^>(1);
      p[ 0 ] = Order::typeid;
      myQueue->Formatter = gcnew XmlMessageFormatter( p );
      try
      {
         // Receive and format the message. 
         Message^ myMessage = myQueue->Receive();
         Order^ myOrder = dynamic_cast<Order^>(myMessage->Body);

         // Display message information.
         Console::WriteLine( "Order ID: {0}", myOrder->orderId );
         Console::WriteLine( "Sent: {0}", myOrder->orderTime );
      }
      catch ( MessageQueueException^ ) 
      {
         // Handle Message Queuing exceptions.
      }
      // Handle invalid serialization format.
      catch ( InvalidOperationException^ e ) 
      {
         Console::WriteLine( e->Message );
      }

      // Catch other exceptions as necessary.
      return;
   }
};

int main()
{
   // Create a new instance of the class.
   MyNewQueue^ myNewQueue = gcnew MyNewQueue;

   // Create a queue on the local computer.
   MyNewQueue::CreateQueue( ".\\myQueue" );

   // Send a message to a queue.
   myNewQueue->SendMessage();

   // Receive a message from a queue.
   myNewQueue->ReceiveMessage();
   return 0;
}
using System;
using System.Messaging;
using System.Drawing;
using System.IO;

namespace MyProject
{

	// The following example 
	// sends to a queue and receives from a queue.
	public class Order
	{
		public int orderId;
		public DateTime orderTime;
	};	

	/// <summary>
	/// Provides a container class for the example.
	/// </summary>
	public class MyNewQueue
	{

		//**************************************************
		// Provides an entry point into the application.
		//		 
		// This example sends and receives a message from
		// a queue.
		//**************************************************

		public static void Main()
		{
			// Create a new instance of the class.
			MyNewQueue myNewQueue = new MyNewQueue();

			// Create a queue on the local computer.
			CreateQueue(".\\myQueue");
			
			// Send a message to a queue.
			myNewQueue.SendMessage();

			// Receive a message from a queue.
			myNewQueue.ReceiveMessage();

			return;
		}

		//**************************************************
		// Creates a new queue.
		//**************************************************

		public static void CreateQueue(string queuePath)
		{
			try	
			{
				if(!MessageQueue.Exists(queuePath))
				{
					MessageQueue.Create(queuePath);
				}
				else
				{
					Console.WriteLine(queuePath + " already exists.");
				}
			}
			catch (MessageQueueException e)
			{
				Console.WriteLine(e.Message);
			}
			
		}

		//**************************************************
		// Sends an Order to a queue.
		//**************************************************
		
		public void SendMessage()
		{
			try
			{

				// Create a new order and set values.
				Order sentOrder = new Order();
				sentOrder.orderId = 3;
				sentOrder.orderTime = DateTime.Now;

				// Connect to a queue on the local computer.
				MessageQueue myQueue = new MessageQueue(".\\myQueue");


				
				// Create the new order.
				Message myMessage = new Message(sentOrder);

				// Send the order to the queue.
				myQueue.Send(myMessage);
			}
			catch(ArgumentException e)
			{
				Console.WriteLine(e.Message);
			
			}

			return;
		}


		//**************************************************
		// Receives a message containing an order.
		//**************************************************
		
		public  void ReceiveMessage()
		{
			// Connect to the a queue on the local computer.
			MessageQueue myQueue = new MessageQueue(".\\myQueue");

			// Set the formatter to indicate body contains an Order.
			myQueue.Formatter = new XmlMessageFormatter(new Type[]
				{typeof(MyProject.Order)});
			
			try
			{
				// Receive and format the message. 
				Message myMessage =	myQueue.Receive(); 
				Order myOrder = (Order)myMessage.Body;

				// Display message information.
				Console.WriteLine("Order ID: " + 
					myOrder.orderId.ToString());
				Console.WriteLine("Sent: " + 
					myOrder.orderTime.ToString());
			}
			
			catch (MessageQueueException)
			{
				// Handle Message Queuing exceptions.
			}

				// Handle invalid serialization format.
			catch (InvalidOperationException e)
			{
				Console.WriteLine(e.Message);
			}
			
			// Catch other exceptions as necessary.

			return;
		}
	}
}
Imports System.Messaging
Imports System.Drawing
Imports System.IO



   
' The following example 
' sends to a queue and receives from a queue.
Public Class Order
      Public orderId As Integer
      Public orderTime As DateTime
End Class 'Order

   
  
' Provides a container class for the example.

Public Class MyNewQueue
      
      

   ' Provides an entry point into the application.
   '		 
   ' This example sends and receives a message from
   ' a queue.

   Public Shared Sub Main()
      ' Create a new instance of the class.
      Dim myNewQueue As New MyNewQueue()
        
      ' Create a queue on the local computer.
      CreateQueue(".\myQueue")
         
      ' Send a message to a queue.
      myNewQueue.SendMessage()
       
      ' Receive a message from a queue.
      myNewQueue.ReceiveMessage()
         
      Return
   End Sub
      
      

      ' Creates a new queue.
   Public Shared Sub CreateQueue(queuePath As String)
      Try
         If Not MessageQueue.Exists(queuePath) Then
            MessageQueue.Create(queuePath)
         Else
            Console.WriteLine((queuePath + " already exists."))
         End If
      Catch e As MessageQueueException
         Console.WriteLine(e.Message)
      End Try
   End Sub
       
      

      ' Sends an Order to a queue.

   Public Sub SendMessage()
      Try
            
            ' Create a new order and set values.
            Dim sentOrder As New Order()
            sentOrder.orderId = 3
            sentOrder.orderTime = DateTime.Now
            
            ' Connect to a queue on the local computer.
            Dim myQueue As New MessageQueue(".\myQueue")
            
            
            
            ' Create the new order.
            Dim myMessage As New Message(sentOrder)
            
            ' Send the order to the queue.
            myQueue.Send(myMessage)
      Catch e As ArgumentException
            Console.WriteLine(e.Message)
      End Try 
         
      Return
   End Sub
      
      
      
 
      ' Receives a message containing an order.
 
   Public Sub ReceiveMessage()
         ' Connect to the a queue on the local computer.
         Dim myQueue As New MessageQueue(".\myQueue")
         
         ' Set the formatter to indicate body contains an Order.
         myQueue.Formatter = New XmlMessageFormatter(New Type() {GetType(Order)})
         
         Try
            ' Receive and format the message. 
            Dim myMessage As Message = myQueue.Receive()
            Dim myOrder As Order = CType(myMessage.Body, Order)
            
            ' Display message information.
            Console.WriteLine(("Order ID: " + myOrder.orderId.ToString()))
            Console.WriteLine(("Sent: " + myOrder.orderTime.ToString()))
         
  
         ' Handle invalid serialization format.
         Catch e As InvalidOperationException
            Console.WriteLine(e.Message)
         End Try
         
         ' Catch other exceptions as necessary.
         Return
   End Sub
End Class 'MyNewQueue

備註

您可以使用類別來查看或接收佇列中的訊息, 或在傳送訊息至佇列時, 能夠更精確地控制訊息屬性。 MessageUse the Message class to peek or receive messages from a queue, or to have fine control over message properties when sending a message to a queue.

MessageQueue會在從佇列查看或接收訊息時使用MessageQueue.Peek MessageQueue.Receive Message Message類別, 因為和方法都會建立類別的新實例, 並設定實例的屬性。MessageQueue uses the Message class when it peeks or receives messages from queues, because both the MessageQueue.Peek and MessageQueue.Receive methods create a new instance of the Message class and set the instance's properties. Message類別的唯讀屬性會套用至從佇列中抓取訊息, 而讀取/寫入屬性則適用于傳送和抓取訊息。The Message class's read-only properties apply to retrieving messages from a queue, while the read/write properties apply to sending and retrieving messages. MessageQueue從佇列中查看或接收訊息時, 其MessageReadPropertyFilter屬性會決定要抓取哪一個訊息的屬性。When MessageQueue peeks or receives a message from a queue, its MessageReadPropertyFilter property determines which of the message's properties are retrieved.

MessageQueue類別的Send方法可讓您指定傳送至該佇列之訊息的任何物件類型。The MessageQueue class's Send method allows you to specify any object type for a message being sent to that queue. 您可以使用MessageQueue實例的DefaultPropertiesToSend屬性, 指定傳送至佇列之一般訊息的設定。You can use the MessageQueue instance's DefaultPropertiesToSend property to specify settings for generic messages sent to the queue. 設定的類型包括格式器、標籤、加密和驗證。The types of settings include formatter, label, encryption, and authentication. 當您協調訊息應用程式來回應DefaultPropertiesToSend通知和報告訊息時, 您也可以指定適當成員的值。You can also specify values for the appropriate DefaultPropertiesToSend members when you coordinate your messaging application to respond to acknowledgment and report messages. Message使用實例將訊息傳送至佇列, 可讓您彈性地存取和修改這些屬性的許多內容, 不論是單一訊息或依訊息的基礎。Using a Message instance to send a message to the queue gives you the flexibility to access and modify many of these properties - either for a single message or on a message-by-message basis. Message屬性的優先順序高於DefaultPropertiesToSendMessage properties take precedence over DefaultPropertiesToSend.

訊息資料會儲存在Body屬性中AppSpecific , 以及較小的範圍、和Extension屬性。Message data is stored in the Body property and to a lesser extent, the AppSpecific and Extension properties. 當訊息資料已加密、序列化或還原序列化時, 只有Body屬性的內容會受到影響。When message data is encrypted, serialized, or deserialized, only the contents of the Body property are affected.

當傳送訊息時Body , 會使用您指定的Formatter屬性來序列化屬性的內容。The contents of the Body property are serialized when the message is sent, using the Formatter property you specify. 序列化的內容可在BodyStream屬性中找到。The serialized contents are found in the BodyStream property. 您也可以直接設定BodyStream屬性, 例如, 將檔案當做訊息的資料內容傳送。You can also set the BodyStream property directly, for example, to send a file as the data content of a message. 您可以在傳送Body訊息Formatter之前隨時變更或屬性, 而且當您呼叫Send時, 資料將會適當地序列化。You can change the Body or Formatter properties at any time before sending the message, and the data will be serialized appropriately when you call Send.

MessageQueue.DefaultPropertiesToSend屬性所定義的屬性僅適用于不屬於類型Message的訊息。The properties defined by the MessageQueue.DefaultPropertiesToSend property apply only to messages that are not of type Message. 如果您指定DefaultPropertiesToSend的屬性MessageQueue, 則傳送至該佇列的Message實例中, 名稱相同的屬性會導致忽略這些預設屬性。If you specify the DefaultPropertiesToSend property for a MessageQueue, the identically named properties in a Message instance sent to that queue cause these default properties to be ignored.

如需實例的Message初始屬性值清單, Message請參閱函數。For a list of initial property values for an instance of Message, see the Message constructor.

建構函式

Message() Message() Message() Message()

初始化包含空主體之 Message 類別的新執行個體。Initializes a new instance of the Message class with an empty body.

Message(Object) Message(Object) Message(Object) Message(Object)

使用 Message 將指定物件序列化到訊息主體中,以初始化 XmlMessageFormatter 類別的新執行個體。Initializes a new instance of the Message class, using the XmlMessageFormatter to serialize the specified object into the body of the message.

Message(Object, IMessageFormatter) Message(Object, IMessageFormatter) Message(Object, IMessageFormatter) Message(Object, IMessageFormatter)

使用指定的格式子將指定物件序列化至訊息主體,初始化 Message 類別的新執行個體。Initializes a new instance of the Message class using the specified formatter to serialize the specified object into the body of the message.

欄位

InfiniteTimeout InfiniteTimeout InfiniteTimeout InfiniteTimeout

指定沒有逾時。Specifies that no time-out exists.

屬性

AcknowledgeType AcknowledgeType AcknowledgeType AcknowledgeType

取得或設定要傳回至負責傳送之應用程式的認可訊息類型。Gets or sets the type of acknowledgment message to be returned to the sending application.

Acknowledgment Acknowledgment Acknowledgment Acknowledgment

取得這個訊息所表示的認可分類。Gets the classification of acknowledgment that this message represents.

AdministrationQueue AdministrationQueue AdministrationQueue AdministrationQueue

取得或設定接收訊息佇列產生之認可訊息的佇列。Gets or sets the queue that receives the acknowledgement messages that Message Queuing generates.

AppSpecific AppSpecific AppSpecific AppSpecific

取得或設定額外的應用程式特定資訊。Gets or sets additional, application-specific information.

ArrivedTime ArrivedTime ArrivedTime ArrivedTime

取得訊息到達目的端佇列的時間。Gets the time that the message arrived in the destination queue.

AttachSenderId AttachSenderId AttachSenderId AttachSenderId

取得或設定值,指出是否應該將傳送者識別碼附加至訊息。Gets or sets a value that indicates whether the sender ID should be attached to the message.

Authenticated Authenticated Authenticated Authenticated

取得指出訊息是否已驗證的值。Gets a value that indicates whether the message was authenticated.

AuthenticationProviderName AuthenticationProviderName AuthenticationProviderName AuthenticationProviderName

取得或設定用來產生訊息之數位簽章的密碼編譯提供者名稱。Gets or sets the name of the cryptographic provider used to generate the digital signature of the message.

AuthenticationProviderType AuthenticationProviderType AuthenticationProviderType AuthenticationProviderType

取得或設定用來產生訊息之數位簽章的密碼編譯提供者類型。Gets or sets the type of cryptographic provider used to generate the digital signature of the message.

Body Body Body Body

取得或設定訊息的內容。Gets or sets the content of the message.

BodyStream BodyStream BodyStream BodyStream

取得或設定訊息主體中的資訊。Gets or sets the information in the body of the message.

BodyType BodyType BodyType BodyType

取得或設定訊息本文包含的資料類型。Gets or sets the type of data that the message body contains.

CanRaiseEvents CanRaiseEvents CanRaiseEvents CanRaiseEvents

取得值,指出元件是否能引發事件。Gets a value indicating whether the component can raise an event.

(Inherited from Component)
ConnectorType ConnectorType ConnectorType ConnectorType

取得或設定值,指出通常由訊息佇列設定的一些訊息屬性已由負責傳送的應用程式設定。Gets or sets a value that indicates that some message properties typically set by Message Queuing were set by the sending application.

Container Container Container Container

取得包含 IContainerComponentGets the IContainer that contains the Component.

(Inherited from Component)
CorrelationId CorrelationId CorrelationId CorrelationId

取得或設定認可、報告和回應訊息用來參考原始訊息的訊息識別項。Gets or sets the message identifier used by acknowledgment, report, and response messages to reference the original message.

DesignMode DesignMode DesignMode DesignMode

取得值,指出 Component 目前是否處於設計模式。Gets a value that indicates whether the Component is currently in design mode.

(Inherited from Component)
DestinationQueue DestinationQueue DestinationQueue DestinationQueue

取得訊息要使用的目的端佇列。Gets the intended destination queue for a message.

DestinationSymmetricKey DestinationSymmetricKey DestinationSymmetricKey DestinationSymmetricKey

取得或設定用來為應用程式加密訊息或傳送至外部佇列的訊息加密的對稱金鑰。Gets or sets the symmetric key used to encrypt application-encrypted messages or messages sent to foreign queues.

DigitalSignature DigitalSignature DigitalSignature DigitalSignature

取得或設定訊息佇列用來驗證訊息的數位簽章。Gets or sets the digital signature that Message Queuing uses to authenticate the message.

EncryptionAlgorithm EncryptionAlgorithm EncryptionAlgorithm EncryptionAlgorithm

取得或設定用來加密私用訊息主體的加密演算法。Gets or sets the encryption algorithm used to encrypt the body of a private message.

Events Events Events Events

取得附加在這個 Component 上的事件處理常式清單。Gets the list of event handlers that are attached to this Component.

(Inherited from Component)
Extension Extension Extension Extension

取得或設定與訊息關聯的其他應用程式定義資訊。Gets or sets additional, application-defined information associated with the message.

Formatter Formatter Formatter Formatter

取得或設定用來將物件序列化成訊息主體,或者從訊息主體將物件還原序列化的格式子。Gets or sets the formatter used to serialize an object into or deserialize an object from the message body.

HashAlgorithm HashAlgorithm HashAlgorithm HashAlgorithm

取得或設定訊息佇列驗證訊息或為訊息建立數位簽章時使用的雜湊演算法。Gets or sets the hashing algorithm that Message Queuing uses when authenticating a message or creating a digital signature for a message.

Id Id Id Id

取得訊息的識別項。Gets the message's identifier.

IsFirstInTransaction IsFirstInTransaction IsFirstInTransaction IsFirstInTransaction

取得值,指出訊息是否為交易中最先傳送的訊息。Gets a value that indicates whether the message was the first message sent in a transaction.

IsLastInTransaction IsLastInTransaction IsLastInTransaction IsLastInTransaction

取得值,指出訊息是否為交易中最後傳送的訊息。Gets a value that indicates whether the message was the last message sent in a transaction.

Label Label Label Label

取得或設定應用程式定義的 Unicode 字串,這個字串會描述訊息。Gets or sets an application-defined Unicode string that describes the message.

LookupId LookupId LookupId LookupId

在 MSMQ 3.0 中介紹。Introduced in MSMQ 3.0. 取得訊息的查詢識別項。Gets the message's lookup identifier.

MessageType MessageType MessageType MessageType

取得訊息類型:NormalAcknowledgmentReportGets the message type: Normal, Acknowledgment, or Report.

Priority Priority Priority Priority

取得或設定訊息的優先權,用來決定訊息放置在佇列中的位置。Gets or sets the message priority, which determines where in the queue the message is placed.

Recoverable Recoverable Recoverable Recoverable

取得或設定值,指出當發生電腦故障或網路問題時是否保證傳遞訊息。Gets or sets a value that indicates whether the message is guaranteed to be delivered in the event of a computer failure or network problem.

ResponseQueue ResponseQueue ResponseQueue ResponseQueue

取得或設定接收應用程式產生的回應訊息的佇列。Gets or sets the queue that receives application-generated response messages.

SecurityContext SecurityContext SecurityContext SecurityContext

取得或設定訊息的安全性內容。Gets or sets the security context for a message.

SenderCertificate SenderCertificate SenderCertificate SenderCertificate

取得或設定用來驗證訊息的安全憑證。Gets or sets the security certificate used to authenticate messages.

SenderId SenderId SenderId SenderId

取得傳送使用者的識別項。Gets the identifier of the sending user.

SenderVersion SenderVersion SenderVersion SenderVersion

取得用來傳送訊息的訊息佇列版本。Gets the version of Message Queuing used to send the message.

SentTime SentTime SentTime SentTime

取得來源佇列管理員傳送訊息時傳送電腦上的日期和時間。Gets the date and time on the sending computer that the message was sent by the source queue manager.

Site Site Site Site

取得或設定 ComponentISiteGets or sets the ISite of the Component.

(Inherited from Component)
SourceMachine SourceMachine SourceMachine SourceMachine

取得發出訊息的電腦。Gets the computer from which the message originated.

TimeToBeReceived TimeToBeReceived TimeToBeReceived TimeToBeReceived

取得或設定要從目的端佇列擷取訊息的最長時間。Gets or sets the maximum amount of time for the message to be received from the destination queue.

TimeToReachQueue TimeToReachQueue TimeToReachQueue TimeToReachQueue

取得或設定訊息抵達佇列的最大時間量。Gets or sets the maximum amount of time for the message to reach the queue.

TransactionId TransactionId TransactionId TransactionId

取得訊息所屬交易的識別項。Gets the identifier for the transaction of which the message was a part.

TransactionStatusQueue TransactionStatusQueue TransactionStatusQueue TransactionStatusQueue

取得來源電腦上的異動狀態佇列。Gets the transaction status queue on the source computer.

UseAuthentication UseAuthentication UseAuthentication UseAuthentication

取得或設定值,指出訊息在傳送之前是否已經 (或必須) 驗證。Gets or sets a value that indicates whether the message was (or must be) authenticated before being sent.

UseDeadLetterQueue UseDeadLetterQueue UseDeadLetterQueue UseDeadLetterQueue

取得或設定值,指出是否應該將無法傳遞的訊息複本傳送至無法投遞的信件佇列。Gets or sets a value that indicates whether a copy of the message that could not be delivered should be sent to a dead-letter queue.

UseEncryption UseEncryption UseEncryption UseEncryption

取得或設定值,指出是否將訊息設成私用。Gets or sets a value that indicates whether to make the message private.

UseJournalQueue UseJournalQueue UseJournalQueue UseJournalQueue

取得或設定值,指出訊息複本是否應保留在原始電腦上的電腦日誌中。Gets or sets a value that indicates whether a copy of the message should be kept in a machine journal on the originating computer.

UseTracing UseTracing UseTracing UseTracing

取得或設定值,指出當訊息向其目的佇列移動時是否要追蹤訊息。Gets or sets a value that indicates whether to trace a message as it moves toward its destination queue.

方法

CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Dispose() Dispose() Dispose() Dispose()

釋放 Component 所使用的所有資源。Releases all resources used by the Component.

(Inherited from Component)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

釋放 Component 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the Component and optionally releases the managed resources.

(Inherited from Component)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetService(Type) GetService(Type) GetService(Type) GetService(Type)

傳回表示 Component 或其 Container 所提供之服務的物件。Returns an object that represents a service provided by the Component or by its Container.

(Inherited from Component)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

取得存留期服務物件,以控制這個執行個體的存留期原則。Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
ToString() ToString() ToString() ToString()

傳回任何包含 Component 名稱的 StringReturns a String containing the name of the Component, if any. 不應覆寫此方法。This method should not be overridden.

(Inherited from Component)

事件

Disposed Disposed Disposed Disposed

當此元件由 Dispose() 方法的呼叫處置時發生。Occurs when the component is disposed by a call to the Dispose() method.

(Inherited from Component)

適用於

另請參閱