BinaryFormatter.UnsafeDeserializeMethodResponse(Stream, HeaderHandler, IMethodCallMessage) BinaryFormatter.UnsafeDeserializeMethodResponse(Stream, HeaderHandler, IMethodCallMessage) BinaryFormatter.UnsafeDeserializeMethodResponse(Stream, HeaderHandler, IMethodCallMessage) BinaryFormatter.UnsafeDeserializeMethodResponse(Stream, HeaderHandler, IMethodCallMessage) Method

定義

將回應還原序列化至來自所提供 Stream 的遠端方法呼叫。Deserializes a response to a remote method call from the provided Stream.

public:
 System::Object ^ UnsafeDeserializeMethodResponse(System::IO::Stream ^ serializationStream, System::Runtime::Remoting::Messaging::HeaderHandler ^ handler, System::Runtime::Remoting::Messaging::IMethodCallMessage ^ methodCallMessage);
[System.Runtime.InteropServices.ComVisible(false)]
[System.Security.SecurityCritical]
public object UnsafeDeserializeMethodResponse (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage);
member this.UnsafeDeserializeMethodResponse : System.IO.Stream * System.Runtime.Remoting.Messaging.HeaderHandler * System.Runtime.Remoting.Messaging.IMethodCallMessage -> obj
Public Function UnsafeDeserializeMethodResponse (serializationStream As Stream, handler As HeaderHandler, methodCallMessage As IMethodCallMessage) As Object

參數

serializationStream
Stream Stream Stream Stream

要還原序列化物件圖形的來源資料流。The stream from which to deserialize the object graph.

handler
HeaderHandler HeaderHandler HeaderHandler HeaderHandler

處理在 serializationStream 中任何標頭的 HeaderHandlerThe HeaderHandler that handles any headers in the serializationStream. 可以是 nullCan be null.

methodCallMessage
IMethodCallMessage IMethodCallMessage IMethodCallMessage IMethodCallMessage

IMethodCallMessage,包含呼叫來源的相關詳細資料。The IMethodCallMessage that contains details about where the call came from.

傳回

對遠端方法呼叫的還原序列化回應。The deserialized response to the remote method call.

例外狀況

serializationStreamnullThe serializationStream is null.

serializationStream 支援搜尋,但是其長度為 0。The serializationStream supports seeking, but its length is 0.

呼叫端沒有必要的使用權限。The caller does not have the required permission.

備註

方法呼叫期間,呼叫端物件的相關詳細資料不會傳送至遠端物件。Details about the caller object are not sent to the remote object during the method call. 相反地,這些詳細資料從傳遞至目前的方法中的原始方法呼叫中取得methodCallMessage參數。Instead, these details are obtained from the original method call that is passed to the current method in the methodCallMessage parameter.

這個方法會使用SecurityAction.LinkDemand若要防止呼叫來自不受信任的程式碼; 只有立即呼叫端必須具有SecurityPermissionAttribute.SerializationFormatter權限。This method uses SecurityAction.LinkDemand to prevent it from being called from untrusted code; only the immediate caller is required to have SecurityPermissionAttribute.SerializationFormatter permission. 請勿使用這個方法,如果您的程式碼可以從部分信任程式碼呼叫。Do not use this method if your code can be called from partially trusted code. 在部分信任案例中,使用DeserializeMethodResponse改。In partially trusted scenarios, use DeserializeMethodResponse instead. 在完全信任情況下,UnsafeDeserializeMethodResponse提供更佳的效能比DeserializeMethodResponseIn full trust scenarios, UnsafeDeserializeMethodResponse provides better performance than DeserializeMethodResponse.

成功的還原序列化資料流中目前的位置必須是物件圖形的開頭。For successful deserialization, the current position in the stream must be at the beginning of the object graph.

重要

使用不信任的資料呼叫此方法,會造成安全性上的風險。Calling this method with untrusted data is a security risk. 呼叫此方法時,請一律使用信任的資料。Call this method only with trusted data. 如需詳細資訊,請參閱資料驗證For more information, see Data Validation.

安全性

SecurityPermission
提供序列化服務。To provide serialization services. 關聯的列舉型別:SerializationFormatterAssociated enumeration: SerializationFormatter.

適用於