แก้ไข

แชร์ผ่าน


XmlTextReader.ProhibitDtd Property

Definition

Caution

Use DtdProcessing property instead.

Caution

XmlTextReader.ProhibitDtd has been deprecated. Use DtdProcessing instead.

Gets or sets a value indicating whether to allow DTD processing. This property is obsolete. Use DtdProcessing instead.

public:
 property bool ProhibitDtd { bool get(); void set(bool value); };
[System.Obsolete("Use DtdProcessing property instead.")]
public bool ProhibitDtd { get; set; }
[System.Obsolete("XmlTextReader.ProhibitDtd has been deprecated. Use DtdProcessing instead.")]
public bool ProhibitDtd { get; set; }
public bool ProhibitDtd { get; set; }
[<System.Obsolete("Use DtdProcessing property instead.")>]
member this.ProhibitDtd : bool with get, set
[<System.Obsolete("XmlTextReader.ProhibitDtd has been deprecated. Use DtdProcessing instead.")>]
member this.ProhibitDtd : bool with get, set
member this.ProhibitDtd : bool with get, set
Public Property ProhibitDtd As Boolean

Property Value

true to disallow DTD processing; otherwise false. The default is false.

Attributes

Remarks

Note

Starting with the .NET Framework 2.0, we recommend that you create XmlReader instances by using the XmlReader.Create method to take advantage of new functionality.

DTD processing is enabled by default for backwards compatibility. However, unless your application requires DTD processing, you should disable this setting. Disabling DTD processing can be useful in preventing certain denial of service attacks. If set to true, the reader throws an XmlException when any DTD content is encountered.

If you have DTD processing enabled, you need to be aware of including DTDs from untrusted sources and possible denial of service attacks. Use the XmlSecureResolver to restrict the resources that the XmlTextReader can access. You can also design your application so that the XML processing is memory and time constrained. For example, configure time-out limits in your ASP.NET application

Applies to

See also