Gets or sets a value indicating whether to allow DTD processing.
Namespace:
System.Xml
Assembly:
System.Xml (in System.Xml.dll)
Visual Basic (Declaration)
Public Property ProhibitDtd As Boolean
Dim instance As XmlTextReader
Dim value As Boolean
value = instance.ProhibitDtd
instance.ProhibitDtd = value
public bool ProhibitDtd { get; set; }
public:
property bool ProhibitDtd {
bool get ();
void set (bool value);
}
public function get ProhibitDtd () : boolean
public function set ProhibitDtd (value : boolean)
Property Value
Type:
System..::.Boolean
true to disallow DTD processing; otherwise false. The default is false.
Note: |
|---|
In the .NET Framework version 2.0 release, the recommended practice is to create XmlReader instances using the XmlReader..::.Create method. This allows you to take full advantage of the new features introduced in this release. For more information, see Creating XML Readers. |
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
For more information, see Security and Your System.Xml Applications.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.NET Framework
Supported in: 3.5, 3.0, 2.0
Reference
Other Resources