BinaryMessageFormatter.CanRead(Message) 方法

定义

确定格式化程序是否可以反序列化消息的内容。

public:
 virtual bool CanRead(System::Messaging::Message ^ message);
public bool CanRead(System.Messaging.Message message);
abstract member CanRead : System.Messaging.Message -> bool
override this.CanRead : System.Messaging.Message -> bool
Public Function CanRead (message As Message) As Boolean

参数

message
Message

Message 检查的。

返回

true 如果二进制消息格式化程序可以反序列化消息,则为 ;否则,为 false.

实现

例外

参数 messagenull.

注解

Important

使用不受信任的数据调用此类中的方法存在安全风险。 仅在确保数据受信任的情况下,再从该类调用方法。 有关详细信息,请参阅验证所有输入

CanRead 如果消息正文不是二进制对象,则 false 返回。

在接收计算机上, CanRead 如果要反序列化的类的程序集存在于本地,则返回 true 。 程序集必须在全局程序集缓存中找到,或链接到应用程序(例如,如果该对象表示自定义类)。

适用于