ActiveXMessageFormatter ActiveXMessageFormatter ActiveXMessageFormatter ActiveXMessageFormatter Class

定義

使用與 MSMQ ActiveX 元件相容的格式,將訊息佇列訊息主體的基本資料型別和其他物件序列化或還原序列化。Serializes or deserializes primitive data types and other objects to or from the body of a Message Queuing message, using a format that is compatible with the MSMQ ActiveX Component.

public ref class ActiveXMessageFormatter : ICloneable, System::Messaging::IMessageFormatter
public class ActiveXMessageFormatter : ICloneable, System.Messaging.IMessageFormatter
type ActiveXMessageFormatter = class
    interface IMessageFormatter
    interface ICloneable
Public Class ActiveXMessageFormatter
Implements ICloneable, IMessageFormatter
繼承
ActiveXMessageFormatterActiveXMessageFormatterActiveXMessageFormatterActiveXMessageFormatter
實作

備註

ActiveXMessageFormatter使用訊息佇列 com 元件所傳送的訊息相容, 允許與使用 MSMQ COM 控制項的應用程式互通。The ActiveXMessageFormatter is compatible with messages sent using Message Queuing COM components, allowing interoperability with applications that use the MSMQ COM control.

可以序列化大部分的基本專案, 以及可IPersistStream執行 OLE 介面的物件。 ActiveXMessageFormatterThe ActiveXMessageFormatter can serialize most primitives, as well as objects that implement the IPersistStream OLE interface. 它可以還原序列化相同的一組基本類型, 但在還原序列化 COM 物件 (例如, 使用 Visual Basic 6.0 建立的物件) 時需要進一步的IPersistStream工作。It can deserialize the same set of primitives, but requires further effort when deserializing a COM object (for example, an object created using Visual Basic 6.0) that implements IPersistStream. 要還原序列化的物件必須先將物件匯入 .NET Framework 應用程式中, 才會在記憶體中。The object to deserialize must be in memory by first importing the object into a .NET Framework application.

當應用程式使用MessageQueue類別的實例將訊息傳送至佇列時, 格式器會將物件序列化為數據流, 並將其插入訊息本文中。When an application sends a message to the queue using an instance of the MessageQueue class, the formatter serializes the object into a stream and inserts it into the message body. 使用MessageQueue從佇列讀取時, 格式器會將訊息資料還原序列化Body為的屬性MessageWhen reading from a queue using a MessageQueue, the formatter deserializes the message data into the Body property of a Message.

ActiveX 序列化非常精簡, 因此使用ActiveXMessageFormatter和 MSMQ COM 控制一個非常快速的序列化方法。ActiveX serialization is very compact, which makes using the ActiveXMessageFormatter and MSMQ COM control a very fast method of serialization.

建構函式

ActiveXMessageFormatter() ActiveXMessageFormatter() ActiveXMessageFormatter() ActiveXMessageFormatter()

初始化 ActiveXMessageFormatter 類別的新執行個體。Initializes a new instance of the ActiveXMessageFormatter class.

方法

CanRead(Message) CanRead(Message) CanRead(Message) CanRead(Message)

決定格式子是否能夠還原序列化訊息的內容。Determines whether the formatter can deserialize the contents of the message.

Clone() Clone() Clone() Clone()

建立一個和目前 ActiveXMessageFormatter 相同的 ActiveXMessageFormatter 類別的執行個體。Creates an instance of the ActiveXMessageFormatter class that is identical to the current ActiveXMessageFormatter.

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)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
InitStreamedObject(Object) InitStreamedObject(Object) InitStreamedObject(Object) InitStreamedObject(Object)

提供公用程式,以協助序列化實作 IPersistStream 並要求呼叫 IPersistStreamInit 的 COM 物件。Provides a utility to help serialize COM objects that implement IPersistStream and require IPersistStreamInit to be called.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
Read(Message) Read(Message) Read(Message) Read(Message)

讀取指定訊息的內容,並建立包含還原序列化訊息的物件。Reads the contents from the given message and creates an object that contains the deserialized message.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)
Write(Message, Object) Write(Message, Object) Write(Message, Object) Write(Message, Object)

將物件序列化到訊息主體中。Serializes an object into the body of the message.

適用於