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 不支持存储对象的反序列化。

message 参数为 null

注解

如果消息正文表示基元类型,则消息的 BodyType 属性必须是下表中的托管类型之一。

BodyType 值 托管类型
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

适用于

另请参阅