Share via


BinaryMessageFormatter 建構函式

定義

初始化 BinaryMessageFormatter 類別的新執行個體。

多載

BinaryMessageFormatter()

初始化 BinaryMessageFormatter 類別的新執行個體,而不指定型別樣式或最上層物件組件樣式。

BinaryMessageFormatter(FormatterAssemblyStyle, FormatterTypeStyle)

初始化 BinaryMessageFormatter 類別的新執行個體,指定根物件和型別描述的格式。

備註

重要

使用不信任的資料呼叫此類別的方法,會造成安全性上的風險。 呼叫此類別的方法時,請一律使用信任的資料。 如需詳細資訊,請參閱 驗證所有輸入

BinaryMessageFormatter()

初始化 BinaryMessageFormatter 類別的新執行個體,而不指定型別樣式或最上層物件組件樣式。

public:
 BinaryMessageFormatter();
public BinaryMessageFormatter ();
Public Sub New ()

備註

您必須指定 TopObjectFormat 屬性的值 (,以定義圖形中根物件的配置方式) 和 TypeFormat 屬性 (定義物件類型描述的配置方式) ,再使用 類別的 BinaryMessageFormatter 實例來串行化和傳送訊息。

適用於

BinaryMessageFormatter(FormatterAssemblyStyle, FormatterTypeStyle)

初始化 BinaryMessageFormatter 類別的新執行個體,指定根物件和型別描述的格式。

public:
 BinaryMessageFormatter(System::Runtime::Serialization::Formatters::FormatterAssemblyStyle topObjectFormat, System::Runtime::Serialization::Formatters::FormatterTypeStyle typeFormat);
public BinaryMessageFormatter (System.Runtime.Serialization.Formatters.FormatterAssemblyStyle topObjectFormat, System.Runtime.Serialization.Formatters.FormatterTypeStyle typeFormat);
new System.Messaging.BinaryMessageFormatter : System.Runtime.Serialization.Formatters.FormatterAssemblyStyle * System.Runtime.Serialization.Formatters.FormatterTypeStyle -> System.Messaging.BinaryMessageFormatter
Public Sub New (topObjectFormat As FormatterAssemblyStyle, typeFormat As FormatterTypeStyle)

參數

topObjectFormat
FormatterAssemblyStyle

決定如何在序列資料流中配置圖形的上層 (根) 物件。

typeFormat
FormatterTypeStyle

決定如何在序列資料流中配置型別描述。

適用於