JsonReaderWriterFactory.CreateJsonReader 方法

定義

建立 XmlDictionaryReader,它可將以 JavaScript 物件標記法 (JSON) 編碼的資料流或緩衝區對應至 XML Infoset。

多載

CreateJsonReader(Byte[], XmlDictionaryReaderQuotas)

建立 XmlDictionaryReader,它可將以 JavaScript 物件標記法 (JSON) 編碼的緩衝區對應至 XML Infoset。

CreateJsonReader(Stream, XmlDictionaryReaderQuotas)

建立 XmlDictionaryReader,它可將以 JavaScript 物件標記法 (JSON) 編碼的資料流對應至 XML Infoset。

CreateJsonReader(Byte[], Int32, Int32, XmlDictionaryReaderQuotas)

建立 XmlDictionaryReader,它可以將具有指定大小和位移、以 JavaScript 物件標記法 (JSON) 編碼的緩衝區對應至 XML Infoset。

CreateJsonReader(Stream, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose)

建立 XmlDictionaryReader,它可以將具有指定大小和位移、以 JavaScript 物件標記法 (JSON) 編碼的資料流對應至 XML Infoset。

CreateJsonReader(Byte[], Int32, Int32, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose)

建立 XmlDictionaryReader,它可以將具有指定大小和位移以及字元編碼、以 JavaScript 物件標記法 (JSON) 編碼的緩衝區對應至 XML Infoset。

備註

每個多載都會使用 XmlDictionaryReaderQuotas 來避免在讀取不受信任的資料時遇到阻斷服務 (DoS) 攻擊。 如需在讀取不受信任資料時使用 XmlDictionaryReaderQuotas 來防止拒絕服務攻擊的詳細資訊,請參閱 資料的安全性考慮

CreateJsonReader(Byte[], XmlDictionaryReaderQuotas)

來源:
JsonReaderWriterFactory.cs
來源:
JsonReaderWriterFactory.cs
來源:
JsonReaderWriterFactory.cs

建立 XmlDictionaryReader,它可將以 JavaScript 物件標記法 (JSON) 編碼的緩衝區對應至 XML Infoset。

public:
 static System::Xml::XmlDictionaryReader ^ CreateJsonReader(cli::array <System::Byte> ^ buffer, System::Xml::XmlDictionaryReaderQuotas ^ quotas);
public static System.Xml.XmlDictionaryReader CreateJsonReader (byte[] buffer, System.Xml.XmlDictionaryReaderQuotas quotas);
static member CreateJsonReader : byte[] * System.Xml.XmlDictionaryReaderQuotas -> System.Xml.XmlDictionaryReader
Public Shared Function CreateJsonReader (buffer As Byte(), quotas As XmlDictionaryReaderQuotas) As XmlDictionaryReader

參數

buffer
Byte[]

要從其中讀取的輸入 Byte 緩衝區陣列。

quotas
XmlDictionaryReaderQuotas

在讀取不受信任的資料時,用來防止阻絕服務攻擊的 XmlDictionaryReaderQuotas

傳回

可以處理 JavaScript 物件標記法 (JSON) 資料的 XmlDictionaryReader

備註

這個多載不會接受 Encoding 參數。 讀取資料時會自動偵測字元編碼 (UTF-8、Unicode 或位元組由大到小的 Unicode)。

如需在讀取不受信任資料時使用 XmlDictionaryReaderQuotas 來防止拒絕服務攻擊的詳細資訊,請參閱 資料的安全性考慮

適用於

CreateJsonReader(Stream, XmlDictionaryReaderQuotas)

來源:
JsonReaderWriterFactory.cs
來源:
JsonReaderWriterFactory.cs
來源:
JsonReaderWriterFactory.cs

建立 XmlDictionaryReader,它可將以 JavaScript 物件標記法 (JSON) 編碼的資料流對應至 XML Infoset。

public:
 static System::Xml::XmlDictionaryReader ^ CreateJsonReader(System::IO::Stream ^ stream, System::Xml::XmlDictionaryReaderQuotas ^ quotas);
public static System.Xml.XmlDictionaryReader CreateJsonReader (System.IO.Stream stream, System.Xml.XmlDictionaryReaderQuotas quotas);
static member CreateJsonReader : System.IO.Stream * System.Xml.XmlDictionaryReaderQuotas -> System.Xml.XmlDictionaryReader
Public Shared Function CreateJsonReader (stream As Stream, quotas As XmlDictionaryReaderQuotas) As XmlDictionaryReader

參數

stream
Stream

要從其中讀取的輸入 Stream

quotas
XmlDictionaryReaderQuotas

在讀取不受信任的資料時,用來防止阻絕服務攻擊的 XmlDictionaryReaderQuotas

傳回

可以讀取 JavaScript 物件標記法 (JSON) 的 XmlDictionaryReader

備註

這個多載不會接受 Encoding 參數。 讀取資料時會自動偵測字元編碼 (UTF-8、Unicode 或位元組由大到小的 Unicode)。

如需在讀取不受信任資料時使用 XmlDictionaryReaderQuotas 來防止拒絕服務攻擊的詳細資訊,請參閱 資料的安全性考慮

適用於

CreateJsonReader(Byte[], Int32, Int32, XmlDictionaryReaderQuotas)

來源:
JsonReaderWriterFactory.cs
來源:
JsonReaderWriterFactory.cs
來源:
JsonReaderWriterFactory.cs

建立 XmlDictionaryReader,它可以將具有指定大小和位移、以 JavaScript 物件標記法 (JSON) 編碼的緩衝區對應至 XML Infoset。

public:
 static System::Xml::XmlDictionaryReader ^ CreateJsonReader(cli::array <System::Byte> ^ buffer, int offset, int count, System::Xml::XmlDictionaryReaderQuotas ^ quotas);
public static System.Xml.XmlDictionaryReader CreateJsonReader (byte[] buffer, int offset, int count, System.Xml.XmlDictionaryReaderQuotas quotas);
static member CreateJsonReader : byte[] * int * int * System.Xml.XmlDictionaryReaderQuotas -> System.Xml.XmlDictionaryReader
Public Shared Function CreateJsonReader (buffer As Byte(), offset As Integer, count As Integer, quotas As XmlDictionaryReaderQuotas) As XmlDictionaryReader

參數

buffer
Byte[]

要從其中讀取的輸入 Byte 緩衝區陣列。

offset
Int32

要在 buffer 中進行讀取的起始位置。

count
Int32

可以從 buffer 中讀取的位元組數目。

quotas
XmlDictionaryReaderQuotas

在讀取不受信任的資料時,用來防止阻絕服務攻擊的 XmlDictionaryReaderQuotas

傳回

可以讀取 JavaScript 物件標記法 (JSON) 的 XmlDictionaryReader

備註

這個多載不會接受 Encoding 參數。 讀取資料時會自動偵測字元編碼 (UTF-8、Unicode 或位元組由大到小的 Unicode)。

如需在讀取不受信任資料時使用 XmlDictionaryReaderQuotas 來防止拒絕服務攻擊的詳細資訊,請參閱 資料的安全性考慮

適用於

CreateJsonReader(Stream, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose)

來源:
JsonReaderWriterFactory.cs
來源:
JsonReaderWriterFactory.cs
來源:
JsonReaderWriterFactory.cs

建立 XmlDictionaryReader,它可以將具有指定大小和位移、以 JavaScript 物件標記法 (JSON) 編碼的資料流對應至 XML Infoset。

public:
 static System::Xml::XmlDictionaryReader ^ CreateJsonReader(System::IO::Stream ^ stream, System::Text::Encoding ^ encoding, System::Xml::XmlDictionaryReaderQuotas ^ quotas, System::Xml::OnXmlDictionaryReaderClose ^ onClose);
public static System.Xml.XmlDictionaryReader CreateJsonReader (System.IO.Stream stream, System.Text.Encoding? encoding, System.Xml.XmlDictionaryReaderQuotas quotas, System.Xml.OnXmlDictionaryReaderClose? onClose);
public static System.Xml.XmlDictionaryReader CreateJsonReader (System.IO.Stream stream, System.Text.Encoding encoding, System.Xml.XmlDictionaryReaderQuotas quotas, System.Xml.OnXmlDictionaryReaderClose onClose);
static member CreateJsonReader : System.IO.Stream * System.Text.Encoding * System.Xml.XmlDictionaryReaderQuotas * System.Xml.OnXmlDictionaryReaderClose -> System.Xml.XmlDictionaryReader
Public Shared Function CreateJsonReader (stream As Stream, encoding As Encoding, quotas As XmlDictionaryReaderQuotas, onClose As OnXmlDictionaryReaderClose) As XmlDictionaryReader

參數

stream
Stream

要從其中讀取的輸入 Stream

encoding
Encoding

Encoding,指定讀取器所使用的字元編碼。 如果指定 null 做為值,讀取器會嘗試自動偵測編碼。

quotas
XmlDictionaryReaderQuotas

在讀取不受信任的資料時,用來防止阻絕服務攻擊的 XmlDictionaryReaderQuotas

onClose
OnXmlDictionaryReaderClose

關閉讀取器時要呼叫的 OnXmlDictionaryReaderClose 委派 (Delegate)。

傳回

可以讀取 JavaScript 物件標記法 (JSON) 的 XmlDictionaryReader

備註

如需在讀取不受信任資料時使用 XmlDictionaryReaderQuotas 來防止拒絕服務攻擊的詳細資訊,請參閱 資料的安全性考慮

適用於

CreateJsonReader(Byte[], Int32, Int32, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose)

來源:
JsonReaderWriterFactory.cs
來源:
JsonReaderWriterFactory.cs
來源:
JsonReaderWriterFactory.cs

建立 XmlDictionaryReader,它可以將具有指定大小和位移以及字元編碼、以 JavaScript 物件標記法 (JSON) 編碼的緩衝區對應至 XML Infoset。

public:
 static System::Xml::XmlDictionaryReader ^ CreateJsonReader(cli::array <System::Byte> ^ buffer, int offset, int count, System::Text::Encoding ^ encoding, System::Xml::XmlDictionaryReaderQuotas ^ quotas, System::Xml::OnXmlDictionaryReaderClose ^ onClose);
public static System.Xml.XmlDictionaryReader CreateJsonReader (byte[] buffer, int offset, int count, System.Text.Encoding? encoding, System.Xml.XmlDictionaryReaderQuotas quotas, System.Xml.OnXmlDictionaryReaderClose? onClose);
public static System.Xml.XmlDictionaryReader CreateJsonReader (byte[] buffer, int offset, int count, System.Text.Encoding encoding, System.Xml.XmlDictionaryReaderQuotas quotas, System.Xml.OnXmlDictionaryReaderClose onClose);
static member CreateJsonReader : byte[] * int * int * System.Text.Encoding * System.Xml.XmlDictionaryReaderQuotas * System.Xml.OnXmlDictionaryReaderClose -> System.Xml.XmlDictionaryReader
Public Shared Function CreateJsonReader (buffer As Byte(), offset As Integer, count As Integer, encoding As Encoding, quotas As XmlDictionaryReaderQuotas, onClose As OnXmlDictionaryReaderClose) As XmlDictionaryReader

參數

buffer
Byte[]

要從其中讀取的輸入 Byte 緩衝區陣列。

offset
Int32

要在 buffer 中進行讀取的起始位置。

count
Int32

可以從 buffer 中讀取的位元組數目。

encoding
Encoding

Encoding,指定讀取器所使用的字元編碼。 如果指定 null 做為值,讀取器會嘗試自動偵測編碼。

quotas
XmlDictionaryReaderQuotas

在讀取不受信任的資料時,用來防止阻絕服務攻擊的 XmlDictionaryReaderQuotas

onClose
OnXmlDictionaryReaderClose

關閉讀取器時要呼叫的 OnXmlDictionaryReaderClose 委派 (Delegate)。 預設值是 null

傳回

可以讀取 JavaScript 物件標記法 (JSON) 的 XmlDictionaryReader

備註

如需在讀取不受信任資料時使用 XmlDictionaryReaderQuotas 來防止拒絕服務攻擊的詳細資訊,請參閱 資料的安全性考慮

適用於