ActiveXMessageFormatter.Read(Message) 方法

定義

讀取指定訊息的內容,並建立包含還原序列化訊息的物件。

public:
 virtual System::Object ^ Read(System::Messaging::Message ^ message);
public object Read (System.Messaging.Message message);
abstract member Read : System.Messaging.Message -> obj
override this.Read : System.Messaging.Message -> obj
Public Function Read (message As Message) As Object

參數

message
Message

要還原序列化的 Message,格式為 MSMQ ActiveX 控制項。

傳回

還原序列化的訊息。

實作

例外狀況

messageBodyType 屬性傳遞的參數無法對應至基本型別,它也不表示一個資料流物件。

主體表示一個預存物件。 ActiveXMessageFormatter 不支援儲存物件的還原序列化 (Deserialization) 格式。

message 參數為 null

備註

如果訊息本文代表基本類型,則訊息的 BodyType 屬性必須是下表中的其中一個 Managed 類型。

BodyType 值 Managed 類型
VT_LPSTR Char 使用 ASCII 編碼) 還原序列化的陣列 (
VT_BSTR,VT_LPWSTR String 使用 Unicode 編碼) 還原序列化 (
VT_VECTOR |VT_UI1 Byte 陣列
VT_BOOL Boolean
VT_CLSID Guid
VT_CY Decimal
VT_DATE DateTime
VT_I1,VT_UI1 Byte
VT_I2 Int16
VT_UI2 UInt16
VT_I4 Int32
VT_UI4 UInt32
VT_I8 Int64
VT_UI8 UInt64
VT_R4 Single
VT_R8 Double
VT_NULL null
VT_STREAMED_OBJECT Object

適用於

另請參閱