BinaryMessageFormatter.CanRead(Message) 方法
定义
确定格式化程序是否可以反序列化消息的内容。Determines whether the formatter can deserialize the contents of the 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
参数
返回
如果二进制消息格式化程序可以反序列化消息,则为 true;否则为 false。true if the binary message formatter can deserialize the message; otherwise, false.
实现
例外
message 参数为 null。The message parameter is null.
注解
重要
使用不受信任的数据调用此类中的方法存在安全风险。Calling methods from this class with untrusted data is a security risk. 仅使用受信任的数据调用此类中的方法。Call the methods from this class only with trusted data. 有关详细信息,请参阅数据验证。For more information, see Data Validation.
CanReadfalse如果消息正文不是二进制对象,则返回。CanRead returns false if the message body is not a binary object.
在接收计算机上, CanRead true 如果要反序列化的类的程序集在本地存在,则返回。On the receiving computer, CanRead returns true if the assembly for the class to be deserialized exists locally. 该程序集必须位于全局程序集缓存中,或链接到应用程序 (例如,如果该对象表示自定义类) 。The assembly must be found in the global assembly cache, or be linked to the application (for example, if the object represents a custom class).